diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-09-24 18:19:21 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-09-24 18:19:21 +0000 |
commit | 1cd230570394513774b42158e7d69ca2439f11ca (patch) | |
tree | 8f40bbef2e0373c2e5b7e4ec938054ef7c3283c3 /clang/lib/Lex/PPExpressions.cpp | |
parent | 43de0f95ed4b63c5e2cab16f6733cbf7c13b1d27 (diff) | |
download | llvm-1cd230570394513774b42158e7d69ca2439f11ca.zip llvm-1cd230570394513774b42158e7d69ca2439f11ca.tar.gz llvm-1cd230570394513774b42158e7d69ca2439f11ca.tar.bz2 |
Change the wording of the extension warning from
> 'long long' is an extension when C99 mode is not enabled
to
> 'long long' is a C++11 extension
while compiling in C++98 mode.
llvm-svn: 164545
Diffstat (limited to 'clang/lib/Lex/PPExpressions.cpp')
-rw-r--r-- | clang/lib/Lex/PPExpressions.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/lib/Lex/PPExpressions.cpp b/clang/lib/Lex/PPExpressions.cpp index f5984f5..d5a88db 100644 --- a/clang/lib/Lex/PPExpressions.cpp +++ b/clang/lib/Lex/PPExpressions.cpp @@ -220,10 +220,15 @@ static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT, if (Literal.hasUDSuffix()) PP.Diag(PeekTok, diag::err_pp_invalid_udl) << /*integer*/1; - // long long is a C99 feature. - if (!PP.getLangOpts().C99 && Literal.isLongLong) - PP.Diag(PeekTok, PP.getLangOpts().CPlusPlus0x ? - diag::warn_cxx98_compat_longlong : diag::ext_longlong); + // 'long long' is a C99 or C++11 feature. + if (!PP.getLangOpts().C99 && Literal.isLongLong) { + if (PP.getLangOpts().CPlusPlus) + PP.Diag(PeekTok, + PP.getLangOpts().CPlusPlus0x ? + diag::warn_cxx98_compat_longlong : diag::ext_cxx11_longlong); + else + PP.Diag(PeekTok, diag::ext_c99_longlong); + } // Parse the integer literal into Result. if (Literal.GetIntegerValue(Result.Val)) { |