llvm-project/clang/lib/Format
Alexander Kornienko 1e80887d63 Use lexing mode based on FormatStyle.Standard.
Summary:
Some valid pre-C++11 constructs change meaning when lexed in C++11
mode, e.g.
#define x(_a) printf("foo"_a);
(example from http://llvm.org/bugs/show_bug.cgi?id=16342). "foo"_a is treated as
a user-defined string literal when parsed in C++11 mode.
In order to deal with this correctly, we need to set lexing mode according to
which standard the code conforms to. We already have a configuration value for
this (FormatStyle.Standard), which seems to be appropriate to use in this case
as well.

Reviewers: klimek

CC: cfe-commits, gribozavr

Differential Revision: http://llvm-reviews.chandlerc.com/D1028

llvm-svn: 185149
2013-06-28 12:51:24 +00:00
..
BreakableToken.cpp Use the same set of whitespace characters for all operations in BreakableToken. 2013-06-20 13:58:37 +00:00
BreakableToken.h Don't remove backslashes from block comments. 2013-06-14 11:46:10 +00:00
CMakeLists.txt Unified token breaking logic for strings and block comments. 2013-04-15 14:28:00 +00:00
Encoding.h UTF-8 support for clang-format. 2013-06-05 14:09:10 +00:00
Format.cpp Use lexing mode based on FormatStyle.Standard. 2013-06-28 12:51:24 +00:00
FormatToken.h Fix a comment. 2013-06-25 19:25:12 +00:00
Makefile
TokenAnnotator.cpp Run clang-format on lib/Format code after r184894. No other changes. 2013-06-26 00:30:14 +00:00
TokenAnnotator.h UTF-8 support for clang-format. 2013-06-05 14:09:10 +00:00
UnwrappedLineParser.cpp Run clang-format on lib/Format code after r184894. No other changes. 2013-06-26 00:30:14 +00:00
UnwrappedLineParser.h Moved FormatToken to a separate header. 2013-06-03 16:45:03 +00:00
WhitespaceManager.cpp Fixes incorrect indentation of line comments after break and re-alignment. 2013-06-17 12:59:44 +00:00
WhitespaceManager.h Insert a space at the start of a line comment in case it starts with an alphanumeric character. 2013-06-11 16:01:49 +00:00