[cfe-commits] [PATCH] Produce -Wc++0x-compat warnings if C++98 code uses C++11 keywords
Douglas Gregor
dgregor at apple.com
Tue Oct 11 14:40:35 PDT 2011
On Oct 11, 2011, at 2:38 PM, David A Dean wrote:
> I'm seeing this test failure:
>
> ******************** TEST 'Clang :: Lexer/cxx0x_keyword_as_cxx98.cpp' FAILED ********************Script:
> --
> /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-gcc42-RA/clang-build/Release+Asserts/bin/clang -cc1 /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-gcc42-RA/clang.src/test/Lexer/cxx0x_keyword_as_cxx98.cpp -verify -fsyntax-only
> --
> Exit Code: 1
> Command Output (stderr):
> --
> error: 'error' diagnostics seen but not expected:
> Line 4: thread-local storage is unsupported for the current target
> 1 error generated.
> --
Perhaps thread_local isn't the best test keyword to use :)
Richard, can you pick something different?
- Doug
> ********************
>
> On 11 Oct 2011, at 1:31 PM, Richard Smith wrote:
>
>> On Tue, October 11, 2011 20:54, Douglas Gregor wrote:
>>> On Oct 11, 2011, at 10:59 AM, Richard Smith wrote:
>>>> The attached patch adds a -Wc++0x-compat warning if a C++11 keyword is used
>>>> when compiling in C++98 mode. The warning is provided only for the first
>>>> usage of each keyword. It has false negatives if the keyword comes from the
>>>> body of a macro, but covers the majority of cases. I'm not very familiar
>>>> with the lexer, so a review would be very much appreciated.
>>>
>>> LGTM.
>>
>> Thanks, in r141700.
>> --
>> Richard
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
> -David
>
>
More information about the cfe-commits
mailing list