forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Clang] Fix how ReadMacroParameterList handles comments in macro para…
…meter-list when in -CC mode Currently when in -CC mode when processing a function like macro ReadMacroParameterList(...) does not handle the case where there is a comment embedded in the parameter-list. Instead of using LexUnexpandedToken(...) I switched to using LexUnexpandedNonComment(...) which eats comments while lexing. Fixes: llvm#60887 Differential Revision: https://reviews.llvm.org/D144511
- Loading branch information
Showing
3 changed files
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,28 @@ | ||
// RUN: %clang_cc1 -E -C %s | FileCheck -check-prefix=CHECK-C -strict-whitespace %s | ||
// CHECK-C: boo bork bar // zot | ||
// CHECK-C: ( 0 ); | ||
// CHECK-C: ( 0,1,2 ); | ||
// CHECK-C: ( 0,1,2 ); | ||
|
||
// RUN: %clang_cc1 -E -CC %s | FileCheck -check-prefix=CHECK-CC -strict-whitespace %s | ||
// CHECK-CC: boo bork /* blah*/ bar // zot | ||
// CHECK-CC: (/**/0/**/); | ||
// CHECK-CC: (/**/0,1,2/**/); | ||
// CHECK-CC: (/**/0,1,2/**/); | ||
|
||
// RUN: %clang_cc1 -E %s | FileCheck -strict-whitespace %s | ||
// CHECK: boo bork bar | ||
// CHECK: ( 0 ); | ||
// CHECK: ( 0,1,2 ); | ||
// CHECK: ( 0,1,2 ); | ||
|
||
|
||
#define FOO bork // blah | ||
boo FOO bar // zot | ||
#define M(/**/x/**/) (/**/x/**/) | ||
M(0); | ||
#define M2(/**/.../**/) (/**/__VA_ARGS__/**/) | ||
M2(0,1,2); | ||
#define M3(/**/x.../**/) (/**/x/**/) | ||
M3(0,1,2); | ||
|