summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/cxx-many-overloads.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-02-08 00:37:45 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-02-08 00:37:45 +0000
commit75fc3bf5fe9ad5ad38492902b07ede50de3f18d4 (patch)
treee121f71514620a61cb040bd3498c9f3dc0a00c04 /clang/test/Modules/cxx-many-overloads.cpp
parente4c7e855f118a9f44af46fbd2e6a17c9c1745a21 (diff)
downloadbcm5719-llvm-75fc3bf5fe9ad5ad38492902b07ede50de3f18d4.tar.gz
bcm5719-llvm-75fc3bf5fe9ad5ad38492902b07ede50de3f18d4.zip
Fix stack overflow and improve performance when a module contains many
overloads of a name by claiming that there are no lookup results for that name in modules while loading the names from the module. Lookups in deserialization really don't want to find names which they themselves are in the process of introducing. This also has the pleasant side-effect of automatically caching PCH lookups which found no names. The runtime here is still quadratic in the number of overloads, but the constant is lower. llvm-svn: 174685
Diffstat (limited to 'clang/test/Modules/cxx-many-overloads.cpp')
-rw-r--r--clang/test/Modules/cxx-many-overloads.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Modules/cxx-many-overloads.cpp b/clang/test/Modules/cxx-many-overloads.cpp
new file mode 100644
index 00000000000..84e4140b939
--- /dev/null
+++ b/clang/test/Modules/cxx-many-overloads.cpp
@@ -0,0 +1,9 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodule-cache-path %t -I %S/Inputs %s -verify
+
+// expected-no-diagnostics
+@import cxx_many_overloads;
+
+void g() {
+ f(N::X<0>());
+}
OpenPOWER on IntegriCloud