summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2017-05-09 03:24:34 +0000
committerRichard Trieu <rtrieu@google.com>2017-05-09 03:24:34 +0000
commitb35ef2a599aa71b4aac027429e0c19d16dc274b7 (patch)
treeb214e6950befcf6c3a6811197489beafc7353896 /clang/test
parent41bb94233bd1a746975f87383722b8e96694f5cd (diff)
downloadbcm5719-llvm-b35ef2a599aa71b4aac027429e0c19d16dc274b7.tar.gz
bcm5719-llvm-b35ef2a599aa71b4aac027429e0c19d16dc274b7.zip
[ODRHash] Loosen checks on typedefs.
When a type in a class is from a typedef, only check the canonical type. Skip checking the intermediate underlying types. This is in response to PR 32965 llvm-svn: 302505
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Modules/odr_hash.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/clang/test/Modules/odr_hash.cpp b/clang/test/Modules/odr_hash.cpp
index 294e925627c..58814dd6b3f 100644
--- a/clang/test/Modules/odr_hash.cpp
+++ b/clang/test/Modules/odr_hash.cpp
@@ -1078,6 +1078,39 @@ S<X> s;
#endif
}
+namespace MultipleTypedefs {
+#if defined(FIRST)
+typedef int B1;
+typedef B1 A1;
+struct S1 {
+ A1 x;
+};
+#elif defined(SECOND)
+typedef int A1;
+struct S1 {
+ A1 x;
+};
+#else
+S1 s1;
+#endif
+
+#if defined(FIRST)
+struct T2 { int x; };
+typedef T2 B2;
+typedef B2 A2;
+struct S2 {
+ T2 x;
+};
+#elif defined(SECOND)
+struct T2 { int x; };
+typedef T2 A2;
+struct S2 {
+ T2 x;
+};
+#else
+S2 s2;
+#endif
+}
// Keep macros contained to one file.
#ifdef FIRST
OpenPOWER on IntegriCloud