summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
authorWeverything <rtrieu@google.com>2020-01-14 21:12:15 -0800
committerWeverything <rtrieu@google.com>2020-01-14 21:12:15 -0800
commita60e8927297005898b10a46300d929ba5cf7833c (patch)
treef49cab14a5a1be6d41c789ecf853e0f8b2649f35 /clang/test/Modules
parent36eedfcb3cea6d4fb0c5998e63596502eb7d32f0 (diff)
downloadbcm5719-llvm-a60e8927297005898b10a46300d929ba5cf7833c.tar.gz
bcm5719-llvm-a60e8927297005898b10a46300d929ba5cf7833c.zip
[ODRHash] Fix wrong error message with bitfields and mutable.
Add a check to bitfield mismatches that may have caused Clang to give an error about the bitfield instead of being mutable.
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/odr_hash.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/clang/test/Modules/odr_hash.cpp b/clang/test/Modules/odr_hash.cpp
index ff7cfb3ae7f..6d26b3cfb57 100644
--- a/clang/test/Modules/odr_hash.cpp
+++ b/clang/test/Modules/odr_hash.cpp
@@ -311,6 +311,20 @@ S9 s9;
#endif
#if defined(FIRST)
+struct S9b {
+ mutable int x : 2;
+};
+#elif defined(SECOND)
+struct S9b {
+ int x : 2;
+};
+#else
+S9b s9b;
+// expected-error@second.h:* {{'Field::S9b' has different definitions in different modules; first difference is definition in module 'SecondModule' found non-mutable field 'x'}}
+// expected-note@first.h:* {{but in 'FirstModule' found mutable field 'x'}}
+#endif
+
+#if defined(FIRST)
struct S10 {
unsigned x = 5;
};
@@ -372,7 +386,9 @@ S13 s13;
unsigned c : 1 + 2; \
s d; \
double e = 1.0; \
- long f[5];
+ long f[5]; \
+ mutable int g; \
+ mutable int h : 5;
#if defined(FIRST) || defined(SECOND)
typedef short s;
OpenPOWER on IntegriCloud