diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-10-11 21:07:39 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-10-11 21:07:39 +0000 |
commit | 5968b1b71f880582dd9cc57e8f3669ba100ee9f9 (patch) | |
tree | 442be3212befcc1c9b2698a4ab424dff6566bce0 /clang/test/Modules/Inputs | |
parent | c9822ebc97035714de8eb3076625e5eab7dd01a6 (diff) | |
download | bcm5719-llvm-5968b1b71f880582dd9cc57e8f3669ba100ee9f9.tar.gz bcm5719-llvm-5968b1b71f880582dd9cc57e8f3669ba100ee9f9.zip |
Diagnose the expansion of ambiguous macro definitions. This can happen
only with modules, when two disjoint modules #define the same
identifier to different token sequences.
llvm-svn: 165746
Diffstat (limited to 'clang/test/Modules/Inputs')
-rw-r--r-- | clang/test/Modules/Inputs/macros_left.h | 4 | ||||
-rw-r--r-- | clang/test/Modules/Inputs/macros_right.h | 6 | ||||
-rw-r--r-- | clang/test/Modules/Inputs/macros_top.h | 8 |
3 files changed, 15 insertions, 3 deletions
diff --git a/clang/test/Modules/Inputs/macros_left.h b/clang/test/Modules/Inputs/macros_left.h index 919dc20ebc9..a2f287e668a 100644 --- a/clang/test/Modules/Inputs/macros_left.h +++ b/clang/test/Modules/Inputs/macros_left.h @@ -7,6 +7,8 @@ #define LEFT_RIGHT_IDENTICAL int -#define LEFT_RIGHT_DIFFERENT float + #define LEFT_RIGHT_DIFFERENT2 float #define LEFT_RIGHT_DIFFERENT3 float + +#define LEFT_RIGHT_DIFFERENT float diff --git a/clang/test/Modules/Inputs/macros_right.h b/clang/test/Modules/Inputs/macros_right.h index 8e9688223bc..a4a1e2e0cfa 100644 --- a/clang/test/Modules/Inputs/macros_right.h +++ b/clang/test/Modules/Inputs/macros_right.h @@ -1,8 +1,8 @@ #include "macros_top.h" #define RIGHT unsigned short -#undef TOP_RIGHT_REDEF -#define TOP_RIGHT_REDEF float + + @@ -13,3 +13,5 @@ #define LEFT_RIGHT_DIFFERENT2 int #define LEFT_RIGHT_DIFFERENT3 int +#undef TOP_RIGHT_REDEF +#define TOP_RIGHT_REDEF float diff --git a/clang/test/Modules/Inputs/macros_top.h b/clang/test/Modules/Inputs/macros_top.h index 1a21848f6c5..5264cea2d17 100644 --- a/clang/test/Modules/Inputs/macros_top.h +++ b/clang/test/Modules/Inputs/macros_top.h @@ -2,4 +2,12 @@ #define TOP_LEFT_UNDEF 1 + + + + + + + + #define TOP_RIGHT_REDEF int |