diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-11-26 02:16:37 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-11-26 02:16:37 +0000 |
| commit | 4a0cd893257d59a21336dcc29b57dbb119da8a6a (patch) | |
| tree | 5ca5da7e89f10449c2db5d69364d314fd319b437 /clang/lib/Sema | |
| parent | a8cfffa3519c11b0eee26a5d1ff9e4a34d46e73b (diff) | |
| download | bcm5719-llvm-4a0cd893257d59a21336dcc29b57dbb119da8a6a.tar.gz bcm5719-llvm-4a0cd893257d59a21336dcc29b57dbb119da8a6a.zip | |
P0002R1: increment on expressions of type bool is no longer allowed in C++1z.
llvm-svn: 254122
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 20f1bdbf5e1..3481f73e693 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -9680,7 +9680,9 @@ static QualType CheckIncrementDecrementOperand(Sema &S, Expr *Op, return QualType(); } // Increment of bool sets it to true, but is deprecated. - S.Diag(OpLoc, diag::warn_increment_bool) << Op->getSourceRange(); + S.Diag(OpLoc, S.getLangOpts().CPlusPlus1z ? diag::ext_increment_bool + : diag::warn_increment_bool) + << Op->getSourceRange(); } else if (S.getLangOpts().CPlusPlus && ResType->isEnumeralType()) { // Error on enum increments and decrements in C++ mode S.Diag(OpLoc, diag::err_increment_decrement_enum) << IsInc << ResType; |

