llvm-project/clang/unittests/Lex
Kadir Cetinkaya ff77071a4d
[clang][Lexer] Make raw and normal lexer behave the same for line comments
Normally there are heruistics in lexer to treat `//*` specially in
language modes that don't have line comments (to emit `/`). Unfortunately this
only applied to the first occurence of a line comment inside the file, as the
subsequent line comments were treated as if language had support for them.

This unfortunately only holds in normal lexing mode, as in raw mode all
occurences of line comments received this treatment, which created discrepancies
when comparing expanded and spelled tokens.

The proper fix would be to just make sure we treat all the line comments with a
subsequent `*` the same way, but it would imply breaking some code that's
accepted by clang today. So instead we introduce the same bug into raw lexing
mode.

Fixes https://github.com/clangd/clangd/issues/1003.

Differential Revision: https://reviews.llvm.org/D118471
2022-01-31 16:15:16 +01:00
..
CMakeLists.txt [clang] Move `ApplyHeaderSearchOptions` from Frontend to Lex 2022-01-11 17:57:40 +01:00
DependencyDirectivesSourceMinimizerTest.cpp [clang][deps] Keep #pragma push_macro, pop_macro and include_alias when minimizing source code. 2021-11-01 16:04:52 -04:00
HeaderMapTest.cpp [clang] NFC: split HeaderMapTest to have re-usable header map implementation for testing 2021-05-31 01:57:36 -07:00
HeaderMapTestUtils.h [clang] NFC: split HeaderMapTest to have re-usable header map implementation for testing 2021-05-31 01:57:36 -07:00
HeaderSearchTest.cpp [clang][lex] NFC: Simplify calls to `LookupFile` 2022-01-18 16:02:18 +01:00
LexerTest.cpp [clang][Lexer] Make raw and normal lexer behave the same for line comments 2022-01-31 16:15:16 +01:00
PPCallbacksTest.cpp Reland "[clang-repl] Implement partial translation units and error recovery." 2021-07-12 15:21:22 +00:00
PPConditionalDirectiveRecordTest.cpp