WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
123406
check-webkit-style should support C++11 rvalue references
https://bugs.webkit.org/show_bug.cgi?id=123406
Summary
check-webkit-style should support C++11 rvalue references
Sergio Villar Senin
Reported
2013-10-28 08:54:49 PDT
The script currently considers: T&& as a mistake due to the missing whitespace before the two ampersands.
Attachments
Patch
(1.51 KB, patch)
2013-11-20 01:11 PST
,
László Langó
no flags
Details
Formatted Diff
Diff
Patch
(2.30 KB, patch)
2013-11-20 04:48 PST
,
László Langó
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
László Langó
Comment 1
2013-11-20 01:11:46 PST
Created
attachment 217405
[details]
Patch
Zan Dobersek
Comment 2
2013-11-20 03:37:29 PST
Comment on
attachment 217405
[details]
Patch This looks OK, but a small test case should be included.
László Langó
Comment 3
2013-11-20 03:45:03 PST
(In reply to
comment #2
)
> (From update of
attachment 217405
[details]
) > This looks OK, but a small test case should be included.
Ok, i'm on it.
László Langó
Comment 4
2013-11-20 04:48:41 PST
Created
attachment 217418
[details]
Patch
Brent Fulgham
Comment 5
2013-11-20 09:29:51 PST
Comment on
attachment 217418
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=217418&action=review
A good start, but I think your logic in the "check_style" change is flawed. I think you allow rvalue references now at the cost of ignoring boolean expressions crossing multiple lines. Please add a test for the multiple-line case and fix the logic for identifying rvalue references.
> Tools/Scripts/webkitpy/style/checkers/cpp.py:2626 > + if cleansed_line.strip().endswith('||') or cleansed_line.strip().endswith(' &&'):
Won't strip() remove all the whitespace? Will we ever match ' &&'?
> Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py:629 > + self.assert_lint('T&&', '')
We also need a test that shows that we catch instances of boolean expressions spanning multiple lines. I believe that your change will break that style check. You can prove me wrong by including a test case! :-)
László Langó
Comment 6
2013-11-20 23:05:32 PST
(In reply to
comment #5
)
> (From update of
attachment 217418
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=217418&action=review
> > A good start, but I think your logic in the "check_style" change is flawed. I think you allow rvalue references now at the cost of ignoring boolean expressions crossing multiple lines. Please add a test for the multiple-line case and fix the logic for identifying rvalue references. > > > Tools/Scripts/webkitpy/style/checkers/cpp.py:2626 > > + if cleansed_line.strip().endswith('||') or cleansed_line.strip().endswith(' &&'): > > Won't strip() remove all the whitespace? Will we ever match ' &&'? > > > Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py:629 > > + self.assert_lint('T&&', '') > > We also need a test that shows that we catch instances of boolean expressions spanning multiple lines. I believe that your change will break that style check. You can prove me wrong by including a test case! :-)
stip() method only remove the leading end trailing whitespaces. It won't remove the whitespace before '&&'. Just to be sure a i checked it before i uploaded the patch. End already exists a test that check the multiline conditions (last assert in 'test_brace_at_begin_of_line').
Brent Fulgham
Comment 7
2013-11-20 23:19:48 PST
Comment on
attachment 217418
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=217418&action=review
R=me
>>> Tools/Scripts/webkitpy/style/checkers/cpp.py:2626 >>> + if cleansed_line.strip().endswith('||') or cleansed_line.strip().endswith(' &&'): >> >> Won't strip() remove all the whitespace? Will we ever match ' &&'? > > stip() method only remove the leading end trailing whitespaces. It won't remove the whitespace before '&&'. Just to be sure a i checked it before i uploaded the patch. End already exists a test that check the multiline conditions (last assert in 'test_brace_at_begin_of_line').
Great! Thanks for confirming.
WebKit Commit Bot
Comment 8
2013-11-20 23:43:49 PST
Comment on
attachment 217418
[details]
Patch Clearing flags on attachment: 217418 Committed
r159612
: <
http://trac.webkit.org/changeset/159612
>
WebKit Commit Bot
Comment 9
2013-11-20 23:43:51 PST
All reviewed patches have been landed. Closing bug.
László Langó
Comment 10
2014-03-21 05:58:36 PDT
***
Bug 73395
has been marked as a duplicate of this bug. ***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug