summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-01-22 01:41:56 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-01-22 01:41:56 +0000
commit5156c3857066396e744137cdadf94fb18fa29da2 (patch)
treeafcc4c56db5547c8bd452d99b338bb50e81f8b55 /clang/test
parent1d59f99f5c1c28035bd5fa35626d5813dc2b0500 (diff)
downloadbcm5719-llvm-5156c3857066396e744137cdadf94fb18fa29da2.tar.gz
bcm5719-llvm-5156c3857066396e744137cdadf94fb18fa29da2.zip
[modules] It's possible to merge into the pattern of a class template before we
load the definition data from the declaration itself. In that case, merge properly; don't assume the prior definition is the same as our own. llvm-svn: 226761
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Modules/Inputs/merge-anon-in-template/a.h4
-rw-r--r--clang/test/Modules/Inputs/merge-anon-in-template/b.h2
-rw-r--r--clang/test/Modules/Inputs/merge-anon-in-template/c.h6
-rw-r--r--clang/test/Modules/Inputs/merge-anon-in-template/module.modulemap3
-rw-r--r--clang/test/Modules/merge-anon-in-template.cc6
5 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/merge-anon-in-template/a.h b/clang/test/Modules/Inputs/merge-anon-in-template/a.h
new file mode 100644
index 00000000000..82540e397bf
--- /dev/null
+++ b/clang/test/Modules/Inputs/merge-anon-in-template/a.h
@@ -0,0 +1,4 @@
+template<typename T> struct is_floating {
+ enum { value = 0 };
+ typedef int type;
+};
diff --git a/clang/test/Modules/Inputs/merge-anon-in-template/b.h b/clang/test/Modules/Inputs/merge-anon-in-template/b.h
new file mode 100644
index 00000000000..87c053d962d
--- /dev/null
+++ b/clang/test/Modules/Inputs/merge-anon-in-template/b.h
@@ -0,0 +1,2 @@
+#include "a.h"
+bool k = is_floating<int>::value;
diff --git a/clang/test/Modules/Inputs/merge-anon-in-template/c.h b/clang/test/Modules/Inputs/merge-anon-in-template/c.h
new file mode 100644
index 00000000000..e0b9b0a3317
--- /dev/null
+++ b/clang/test/Modules/Inputs/merge-anon-in-template/c.h
@@ -0,0 +1,6 @@
+template<typename T> struct is_floating {
+ enum { value = 0 };
+ typedef int type;
+};
+#include "b.h"
+bool n20 = is_floating<int>::value;
diff --git a/clang/test/Modules/Inputs/merge-anon-in-template/module.modulemap b/clang/test/Modules/Inputs/merge-anon-in-template/module.modulemap
new file mode 100644
index 00000000000..77e0a89e39a
--- /dev/null
+++ b/clang/test/Modules/Inputs/merge-anon-in-template/module.modulemap
@@ -0,0 +1,3 @@
+module a { header "a.h" export * }
+module b { header "b.h" export * }
+module c { header "c.h" export * }
diff --git a/clang/test/Modules/merge-anon-in-template.cc b/clang/test/Modules/merge-anon-in-template.cc
new file mode 100644
index 00000000000..6e4e6e09e9c
--- /dev/null
+++ b/clang/test/Modules/merge-anon-in-template.cc
@@ -0,0 +1,6 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I%S/Inputs/merge-anon-in-template -verify %s
+// expected-no-diagnostics
+#include "a.h"
+#include "c.h"
+is_floating<int>::type t;
OpenPOWER on IntegriCloud