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 | 2fcf0de8a122ddb265d8c32d6ac1012c070e4f24 (patch) | |
tree | 6e2b734cc93ba99215f25b74b6530cdf786fe587 /lib/Lex | |
parent | 87a9f2b2d7fb287ccd9ed5dfdbe75cc4ce906122 (diff) |
Note that we support (and in fact have supported since the dawn of time itself)
C++1y binary literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179883 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex')
-rw-r--r-- | lib/Lex/LiteralSupport.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Lex/LiteralSupport.cpp b/lib/Lex/LiteralSupport.cpp index 91da8223c1..09f4a682f0 100644 --- a/lib/Lex/LiteralSupport.cpp +++ b/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; |