summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-04-26 23:40:43 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-04-26 23:40:43 +0000
commitd49941b726815de509ff770227856f8d2a33992a (patch)
tree43bcd11096ea1bc1d9afa2ea5591b79fd567fd22 /clang/test/Modules
parentc2bf63d29da43fa765189ec7b250bcb451b5934b (diff)
downloadbcm5719-llvm-d49941b726815de509ff770227856f8d2a33992a.tar.gz
bcm5719-llvm-d49941b726815de509ff770227856f8d2a33992a.zip
PR27513: When determining which declaration to put into an exported lookup
table for a module / PCH, never map from a normal declaration of a class to an injected-class-name declaration (or vice versa). Those declarations live in distinct lookup tables and should not be confused. We really shouldn't be using a CXXRecordDecl to represent an injected-class-name in the first place; I've filed PR27532 so we don't forget. llvm-svn: 267632
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/Inputs/PR27513/a.h5
-rw-r--r--clang/test/Modules/Inputs/PR27513/b.h3
-rw-r--r--clang/test/Modules/Inputs/PR27513/b1.h1
-rw-r--r--clang/test/Modules/Inputs/PR27513/b11.h2
-rw-r--r--clang/test/Modules/Inputs/PR27513/b111.h3
-rw-r--r--clang/test/Modules/Inputs/PR27513/b1111.h1
-rw-r--r--clang/test/Modules/Inputs/PR27513/b1112.h1
-rw-r--r--clang/test/Modules/Inputs/PR27513/b2.h1
-rw-r--r--clang/test/Modules/Inputs/PR27513/c.h1
-rw-r--r--clang/test/Modules/Inputs/PR27513/module.modulemap7
-rw-r--r--clang/test/Modules/Inputs/PR27513/mystring.h8
-rw-r--r--clang/test/Modules/pr27513.cpp7
12 files changed, 40 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/PR27513/a.h b/clang/test/Modules/Inputs/PR27513/a.h
new file mode 100644
index 00000000000..7eecbf4773d
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR27513/a.h
@@ -0,0 +1,5 @@
+#include "b.h"
+
+inline void f() { basic_string<char> s; }
+
+#include "c.h"
diff --git a/clang/test/Modules/Inputs/PR27513/b.h b/clang/test/Modules/Inputs/PR27513/b.h
new file mode 100644
index 00000000000..b514c1e3476
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR27513/b.h
@@ -0,0 +1,3 @@
+#include "mystring.h"
+#include "b1.h"
+#include "b2.h"
diff --git a/clang/test/Modules/Inputs/PR27513/b1.h b/clang/test/Modules/Inputs/PR27513/b1.h
new file mode 100644
index 00000000000..a12b29f71bf
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR27513/b1.h
@@ -0,0 +1 @@
+#include "b11.h"
diff --git a/clang/test/Modules/Inputs/PR27513/b11.h b/clang/test/Modules/Inputs/PR27513/b11.h
new file mode 100644
index 00000000000..e7bfaec9ce7
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR27513/b11.h
@@ -0,0 +1,2 @@
+#include "mystring.h"
+#include "b111.h"
diff --git a/clang/test/Modules/Inputs/PR27513/b111.h b/clang/test/Modules/Inputs/PR27513/b111.h
new file mode 100644
index 00000000000..b7a63b5c232
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR27513/b111.h
@@ -0,0 +1,3 @@
+#include "mystring.h"
+#include "b1111.h"
+#include "b1112.h"
diff --git a/clang/test/Modules/Inputs/PR27513/b1111.h b/clang/test/Modules/Inputs/PR27513/b1111.h
new file mode 100644
index 00000000000..3f9cf449b37
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR27513/b1111.h
@@ -0,0 +1 @@
+#include "mystring.h"
diff --git a/clang/test/Modules/Inputs/PR27513/b1112.h b/clang/test/Modules/Inputs/PR27513/b1112.h
new file mode 100644
index 00000000000..3f9cf449b37
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR27513/b1112.h
@@ -0,0 +1 @@
+#include "mystring.h"
diff --git a/clang/test/Modules/Inputs/PR27513/b2.h b/clang/test/Modules/Inputs/PR27513/b2.h
new file mode 100644
index 00000000000..3f9cf449b37
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR27513/b2.h
@@ -0,0 +1 @@
+#include "mystring.h"
diff --git a/clang/test/Modules/Inputs/PR27513/c.h b/clang/test/Modules/Inputs/PR27513/c.h
new file mode 100644
index 00000000000..3f9cf449b37
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR27513/c.h
@@ -0,0 +1 @@
+#include "mystring.h"
diff --git a/clang/test/Modules/Inputs/PR27513/module.modulemap b/clang/test/Modules/Inputs/PR27513/module.modulemap
new file mode 100644
index 00000000000..ee2a9ce4aa5
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR27513/module.modulemap
@@ -0,0 +1,7 @@
+module "c.h" {header "c.h" export *}
+module "b2.h" { header "b2.h" export *}
+module "b.h" {header "b.h" export *}
+module "b111.h" { header "b111.h" export *}
+module "b11.h" { header "b11.h" export *}
+module "b1111.h" { header "b1111.h" export *}
+module "b1112.h" { header "b1112.h" export *}
diff --git a/clang/test/Modules/Inputs/PR27513/mystring.h b/clang/test/Modules/Inputs/PR27513/mystring.h
new file mode 100644
index 00000000000..95680ed8837
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR27513/mystring.h
@@ -0,0 +1,8 @@
+#ifndef _GLIBCXX_STRING
+#define _GLIBCXX_STRING
+template<typename> struct basic_string {
+ struct _Alloc_hider {} _M_dataplus;
+ ~basic_string() { _Alloc_hider h; }
+};
+extern template class basic_string<char>;
+#endif
diff --git a/clang/test/Modules/pr27513.cpp b/clang/test/Modules/pr27513.cpp
new file mode 100644
index 00000000000..28fbe5bd825
--- /dev/null
+++ b/clang/test/Modules/pr27513.cpp
@@ -0,0 +1,7 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -std=c++11 -I%S/Inputs/PR27513 -verify %s
+// RUN: %clang_cc1 -std=c++11 -fmodules -fmodule-map-file=%S/Inputs/PR27513/module.modulemap -fmodules-cache-path=%t -I%S/Inputs/PR27513 -verify %s
+
+#include "Inputs/PR27513/a.h"
+
+//expected-no-diagnostics
OpenPOWER on IntegriCloud