diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2017-10-15 15:01:42 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2017-10-15 15:01:42 +0000 |
commit | 606093a53ba6effd69bca68bda3088325f2fcd7e (patch) | |
tree | dbac3f8f72c61a259e9ef58cee99cdca459e7bcf /clang/lib/Lex | |
parent | 30f30d37fb15fc59ffe71e8d7a24457ff6e2a184 (diff) | |
download | bcm5719-llvm-606093a53ba6effd69bca68bda3088325f2fcd7e.tar.gz bcm5719-llvm-606093a53ba6effd69bca68bda3088325f2fcd7e.zip |
Add -f[no-]double-square-bracket-attributes as new driver options to control use of [[]] attributes in all language modes. This is the initial implementation of WG14 N2165, which is a proposal to add [[]] attributes to C2x, but also allows you to enable these attributes in C++98, or disable them in C++11 or later.
llvm-svn: 315856
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r-- | clang/lib/Lex/Lexer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index b85e0f03dc0..5132d0e62c2 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -3612,7 +3612,9 @@ LexNextToken: if (LangOpts.Digraphs && Char == '>') { Kind = tok::r_square; // ':>' -> ']' CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); - } else if (LangOpts.CPlusPlus && Char == ':') { + } else if ((LangOpts.CPlusPlus || + LangOpts.DoubleSquareBracketAttributes) && + Char == ':') { Kind = tok::coloncolon; CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); } else { |