summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Misc/ast-dump-decl.cpp1
-rw-r--r--clang/test/Modules/Inputs/PR31469/empty.h1
-rw-r--r--clang/test/Modules/Inputs/PR31469/module.modulemap5
-rw-r--r--clang/test/Modules/Inputs/PR31469/textual.h17
-rw-r--r--clang/test/Modules/Inputs/PR31469/textual_file_shadow.h2
-rw-r--r--clang/test/Modules/pr31469.cpp15
6 files changed, 40 insertions, 1 deletions
diff --git a/clang/test/Misc/ast-dump-decl.cpp b/clang/test/Misc/ast-dump-decl.cpp
index 1cfcd509efa..c966e133eb5 100644
--- a/clang/test/Misc/ast-dump-decl.cpp
+++ b/clang/test/Misc/ast-dump-decl.cpp
@@ -336,7 +336,6 @@ namespace testCanonicalTemplate {
// CHECK-NEXT: ClassTemplateDecl{{.*}} TestClassTemplate
// CHECK-NEXT: TemplateTypeParmDecl
// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate
- // CHECK-NEXT: ClassTemplateSpecialization{{.*}} 'TestClassTemplate'
// CHECK-NEXT: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate
// CHECK-NEXT: TemplateArgument{{.*}}A
// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate
diff --git a/clang/test/Modules/Inputs/PR31469/empty.h b/clang/test/Modules/Inputs/PR31469/empty.h
new file mode 100644
index 00000000000..51e115f57fc
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR31469/empty.h
@@ -0,0 +1 @@
+// This file is triggers loading of module M.
diff --git a/clang/test/Modules/Inputs/PR31469/module.modulemap b/clang/test/Modules/Inputs/PR31469/module.modulemap
new file mode 100644
index 00000000000..bada81d04ee
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR31469/module.modulemap
@@ -0,0 +1,5 @@
+module M {
+ module "textual_shadow" { header "textual_file_shadow.h" export *}
+ module "trigger" { header "empty.h" export * }
+ export *
+}
diff --git a/clang/test/Modules/Inputs/PR31469/textual.h b/clang/test/Modules/Inputs/PR31469/textual.h
new file mode 100644
index 00000000000..abdc662fb5e
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR31469/textual.h
@@ -0,0 +1,17 @@
+namespace A {
+inline
+namespace __1 {
+ template <class _Tp> class allocator;
+ template <class _Tp, class _Alloc = allocator<_Tp>> class list;
+ template <class _VoidPtr> class __list_iterator {
+ //template <class> friend class list; // causes another crash in ASTDeclReader::attachPreviousDecl
+ template <class, class> friend class list;
+ };
+ template <class _Tp, class _Alloc> class __list_imp {};
+ template <class _Tp, class _Alloc> class list : __list_imp<_Tp, _Alloc> {
+ public:
+ list() {}
+ };
+ template <class _Tp> void f(list<_Tp>);
+}
+}
diff --git a/clang/test/Modules/Inputs/PR31469/textual_file_shadow.h b/clang/test/Modules/Inputs/PR31469/textual_file_shadow.h
new file mode 100644
index 00000000000..48a53dd4a83
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR31469/textual_file_shadow.h
@@ -0,0 +1,2 @@
+#include "textual.h"
+
diff --git a/clang/test/Modules/pr31469.cpp b/clang/test/Modules/pr31469.cpp
new file mode 100644
index 00000000000..8f7d52285c8
--- /dev/null
+++ b/clang/test/Modules/pr31469.cpp
@@ -0,0 +1,15 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -std=c++11 -I%S/Inputs/PR31469 -verify %s
+// RUN: %clang_cc1 -std=c++11 -I%S/Inputs/PR31469 -fmodules -fmodules-local-submodule-visibility \
+// RUN: -fimplicit-module-maps -fmodules-cache-path=%t -verify %s
+
+#include "textual.h"
+#include "empty.h"
+
+namespace A {
+ template <class _Tp> void f();
+}
+
+A::list<int> use;
+
+// expected-no-diagnostics
OpenPOWER on IntegriCloud