summaryrefslogtreecommitdiffstats
path: root/clang/test/PCH/chain-empty-initial-namespace.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2011-04-24 16:27:54 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2011-04-24 16:27:54 +0000
commitf830df4e9d1aa0c6971de46d0b8c899788443cb9 (patch)
tree8003dabd2a618462b66c1c33c167d0d4272d4146 /clang/test/PCH/chain-empty-initial-namespace.cpp
parent83f3b859abfb1817089374542d1fe030e887d149 (diff)
downloadbcm5719-llvm-f830df4e9d1aa0c6971de46d0b8c899788443cb9.tar.gz
bcm5719-llvm-f830df4e9d1aa0c6971de46d0b8c899788443cb9.zip
On reading DeclContexts from PCH, check for visible updates even if the context was empty in the original version. Also, if there are any, tell the context that it has external visible decls. This fixes the problem that a namespace that was empty in the initial PCH (could also happen if the initial PCH didn't include any std header but caused implicit creation of namespace std, e.g. due to implicit declaration of a virtual destructor) never found any declaration declared in *any* chained PCH. Very ugly when the chained PCH includes all that std stuff, as the errors were effectively the same as not including std headers.
llvm-svn: 130102
Diffstat (limited to 'clang/test/PCH/chain-empty-initial-namespace.cpp')
-rw-r--r--clang/test/PCH/chain-empty-initial-namespace.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/PCH/chain-empty-initial-namespace.cpp b/clang/test/PCH/chain-empty-initial-namespace.cpp
new file mode 100644
index 00000000000..bf15caa72cd
--- /dev/null
+++ b/clang/test/PCH/chain-empty-initial-namespace.cpp
@@ -0,0 +1,24 @@
+// no PCH
+// RUN: %clang_cc1 -include %s -include %s -fsyntax-only %s
+// full PCH
+// RUN: %clang_cc1 -chain-include %s -chain-include %s -fsyntax-only %s
+#if !defined(PASS1)
+#define PASS1
+
+namespace foo {} // no external storage
+
+#elif !defined(PASS2)
+#define PASS2
+
+namespace foo {
+ void bar();
+}
+
+#else
+// PASS3
+
+void test() {
+ foo::bar(); // no-error
+}
+
+#endif
OpenPOWER on IntegriCloud