diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-11-08 06:08:42 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-11-08 06:08:42 +0000 |
commit | 3e3a705062fe343dc397c0bf623aa383f14ce07c (patch) | |
tree | c22a037420f5961f40672567865afc4591809a78 /clang/lib/Lex/TokenConcatenation.cpp | |
parent | cf29675d9501cfff2a37acb8af3eefa6cbba19c1 (diff) | |
download | bcm5719-llvm-3e3a705062fe343dc397c0bf623aa383f14ce07c.tar.gz bcm5719-llvm-3e3a705062fe343dc397c0bf623aa383f14ce07c.zip |
[c++1z] Support for u8 character literals.
llvm-svn: 221576
Diffstat (limited to 'clang/lib/Lex/TokenConcatenation.cpp')
-rw-r--r-- | clang/lib/Lex/TokenConcatenation.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Lex/TokenConcatenation.cpp b/clang/lib/Lex/TokenConcatenation.cpp index 866cbb142c8..08327496ab8 100644 --- a/clang/lib/Lex/TokenConcatenation.cpp +++ b/clang/lib/Lex/TokenConcatenation.cpp @@ -99,6 +99,10 @@ TokenConcatenation::TokenConcatenation(Preprocessor &pp) : PP(pp) { TokenInfo[tok::utf32_char_constant ] |= aci_custom; } + // These tokens have custom code in C++1z mode. + if (PP.getLangOpts().CPlusPlus1z) + TokenInfo[tok::utf8_char_constant] |= aci_custom; + // These tokens change behavior if followed by an '='. TokenInfo[tok::amp ] |= aci_avoid_equal; // &= TokenInfo[tok::plus ] |= aci_avoid_equal; // += @@ -213,6 +217,7 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok, case tok::utf32_string_literal: case tok::char_constant: case tok::wide_char_constant: + case tok::utf8_char_constant: case tok::utf16_char_constant: case tok::utf32_char_constant: if (!PP.getLangOpts().CPlusPlus11) @@ -236,7 +241,8 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok, if (Tok.getIdentifierInfo() || Tok.is(tok::wide_string_literal) || Tok.is(tok::utf8_string_literal) || Tok.is(tok::utf16_string_literal) || Tok.is(tok::utf32_string_literal) || Tok.is(tok::wide_char_constant) || - Tok.is(tok::utf16_char_constant) || Tok.is(tok::utf32_char_constant)) + Tok.is(tok::utf8_char_constant) || Tok.is(tok::utf16_char_constant) || + Tok.is(tok::utf32_char_constant)) return true; // If this isn't identifier + string, we're done. |