diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-04-19 20:47:20 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-04-19 20:47:20 +0000 |
commit | c5c27f2a1f2610ea32c249f3def799ca97a65f6e (patch) | |
tree | 46fd170437b34eabf0479ee3f536cbc38375d498 /clang/lib/Lex/LiteralSupport.cpp | |
parent | 7f2ab897743a9d0fafeb7bb2d28d732ac46275bf (diff) | |
download | bcm5719-llvm-c5c27f2a1f2610ea32c249f3def799ca97a65f6e.tar.gz bcm5719-llvm-c5c27f2a1f2610ea32c249f3def799ca97a65f6e.zip |
Note that we support (and in fact have supported since the dawn of time itself)
C++1y binary literals.
llvm-svn: 179883
Diffstat (limited to 'clang/lib/Lex/LiteralSupport.cpp')
-rw-r--r-- | clang/lib/Lex/LiteralSupport.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp index 91da8223c18..09f4a682f05 100644 --- a/clang/lib/Lex/LiteralSupport.cpp +++ b/clang/lib/Lex/LiteralSupport.cpp @@ -686,8 +686,13 @@ void NumericLiteralParser::ParseNumberStartingWithZero(SourceLocation TokLoc) { // Handle simple binary numbers 0b01010 if (*s == 'b' || *s == 'B') { - // 0b101010 is a GCC extension. - PP.Diag(TokLoc, diag::ext_binary_literal); + // 0b101010 is a C++1y / GCC extension. + PP.Diag(TokLoc, + PP.getLangOpts().CPlusPlus1y + ? diag::warn_cxx11_compat_binary_literal + : PP.getLangOpts().CPlusPlus + ? diag::ext_binary_literal_cxx1y + : diag::ext_binary_literal); ++s; radix = 2; DigitsBegin = s; |