aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Lexer.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-03-11 18:01:42 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-03-11 18:01:42 +0000
commitd4bf760d057f1e8724ab7be340a2d42adae0900a (patch)
tree0a25eeac5a51b382e457168eefdcd2ee74ab20f2 /lib/Lex/Lexer.cpp
parentf96df9083937e198721f0e1dbd21d882bb4413ae (diff)
Add -Wc99-compat warning for C11 unicode string and character literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r--lib/Lex/Lexer.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp
index e6cc8b929c..ed4666aa21 100644
--- a/lib/Lex/Lexer.cpp
+++ b/lib/Lex/Lexer.cpp
@@ -1629,9 +1629,10 @@ void Lexer::LexStringLiteral(Token &Result, const char *CurPtr,
if (!isLexingRawMode() &&
(Kind == tok::utf8_string_literal ||
Kind == tok::utf16_string_literal ||
- Kind == tok::utf32_string_literal) &&
- getLangOpts().CPlusPlus)
- Diag(BufferPtr, diag::warn_cxx98_compat_unicode_literal);
+ Kind == tok::utf32_string_literal))
+ Diag(BufferPtr, getLangOpts().CPlusPlus
+ ? diag::warn_cxx98_compat_unicode_literal
+ : diag::warn_c99_compat_unicode_literal);
char C = getAndAdvanceChar(CurPtr, Result);
while (C != '"') {
@@ -1795,9 +1796,10 @@ void Lexer::LexCharConstant(Token &Result, const char *CurPtr,
const char *NulCharacter = 0; // Does this character contain the \0 character?
if (!isLexingRawMode() &&
- (Kind == tok::utf16_char_constant || Kind == tok::utf32_char_constant) &&
- getLangOpts().CPlusPlus)
- Diag(BufferPtr, diag::warn_cxx98_compat_unicode_literal);
+ (Kind == tok::utf16_char_constant || Kind == tok::utf32_char_constant))
+ Diag(BufferPtr, getLangOpts().CPlusPlus
+ ? diag::warn_cxx98_compat_unicode_literal
+ : diag::warn_c99_compat_unicode_literal);
char C = getAndAdvanceChar(CurPtr, Result);
if (C == '\'') {