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
diff --git a/lib/Lex/LiteralSupport.cpp b/lib/Lex/LiteralSupport.cpp
index 91da822..09f4a68 100644
--- a/lib/Lex/LiteralSupport.cpp
+++ b/lib/Lex/LiteralSupport.cpp
@@ -686,8 +686,13 @@
// 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;