summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2015-11-14 03:26:14 +0000
committerBen Langmuir <blangmuir@apple.com>2015-11-14 03:26:14 +0000
commit90717ad7318074ed5069cfbd14e36f10082262ea (patch)
tree4228da15fea4dcd384a860dce078f60d0a5fd621 /clang/test
parent57a6e1321fc3dc37f04beeb38653aefc72b6e34d (diff)
downloadbcm5719-llvm-90717ad7318074ed5069cfbd14e36f10082262ea.tar.gz
bcm5719-llvm-90717ad7318074ed5069cfbd14e36f10082262ea.zip
[modules] Allow "redefinition" of typedef of anon tag from unimported submodule
r233345 started being stricter about typedef names for linkage purposes in non-visible modules, but broke languages without the ODR. rdar://23527954 llvm-svn: 253123
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Index/usrs.m2
-rw-r--r--clang/test/Modules/Inputs/module.map7
-rw-r--r--clang/test/Modules/Inputs/typedef-tag-hidden.h1
-rw-r--r--clang/test/Modules/Inputs/typedef-tag.h1
-rw-r--r--clang/test/Modules/typedef-tag-not-visible.m8
5 files changed, 18 insertions, 1 deletions
diff --git a/clang/test/Index/usrs.m b/clang/test/Index/usrs.m
index aa0c4a04fc7..fc3fbc91057 100644
--- a/clang/test/Index/usrs.m
+++ b/clang/test/Index/usrs.m
@@ -119,7 +119,7 @@ int test_multi_declaration(void) {
// CHECK: usrs.m c:@SA@MyStruct Extent=[15:9 - 18:2]
// CHECK: usrs.m c:@SA@MyStruct@FI@wa Extent=[16:3 - 16:9]
// CHECK: usrs.m c:@SA@MyStruct@FI@moo Extent=[17:3 - 17:10]
-// CHECK: usrs.m c:@T@MyStruct Extent=[15:1 - 18:11]
+// CHECK: usrs.m c:usrs.m@T@MyStruct Extent=[15:1 - 18:11]
// CHECK: usrs.m c:@E@Pizza Extent=[20:1 - 23:2]
// CHECK: usrs.m c:@E@Pizza@CHEESE Extent=[21:3 - 21:9]
// CHECK: usrs.m c:@E@Pizza@MUSHROOMS Extent=[22:3 - 22:12]
diff --git a/clang/test/Modules/Inputs/module.map b/clang/test/Modules/Inputs/module.map
index d195e2f0980..226d45fdf44 100644
--- a/clang/test/Modules/Inputs/module.map
+++ b/clang/test/Modules/Inputs/module.map
@@ -379,3 +379,10 @@ module DebugSubmodules {
module ExtensionTestA {
header "ExtensionTestA.h"
}
+
+module TypedefTag {
+ header "typedef-tag.h"
+ explicit module Hidden {
+ header "typedef-tag-hidden.h"
+ }
+}
diff --git a/clang/test/Modules/Inputs/typedef-tag-hidden.h b/clang/test/Modules/Inputs/typedef-tag-hidden.h
new file mode 100644
index 00000000000..eb59d69cc6e
--- /dev/null
+++ b/clang/test/Modules/Inputs/typedef-tag-hidden.h
@@ -0,0 +1 @@
+typedef struct { int x; } TypedefStructHidden_t;
diff --git a/clang/test/Modules/Inputs/typedef-tag.h b/clang/test/Modules/Inputs/typedef-tag.h
new file mode 100644
index 00000000000..77dff951174
--- /dev/null
+++ b/clang/test/Modules/Inputs/typedef-tag.h
@@ -0,0 +1 @@
+typedef struct { int x; } TypedefStructVisible_t;
diff --git a/clang/test/Modules/typedef-tag-not-visible.m b/clang/test/Modules/typedef-tag-not-visible.m
new file mode 100644
index 00000000000..e1a640633f6
--- /dev/null
+++ b/clang/test/Modules/typedef-tag-not-visible.m
@@ -0,0 +1,8 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs %s -verify
+
+@import TypedefTag;
+
+typedef struct { int x; } TypedefStructHidden_t;
+typedef struct { int x; } TypedefStructVisible_t; // expected-error{{typedef redefinition}}
+// expected-note@typedef-tag.h:1 {{here}}
OpenPOWER on IntegriCloud