summaryrefslogtreecommitdiffstats
path: root/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
commit2bb07c1dfeda50d7edcee512932b86a1a65c6e69 (patch)
treedbe3bfc7737c2f75676461415704be2a6a1734d8 /test/Modules/cxx-many-overloads.cpp
parentada7191795dde85a620008094fbe5464abdb916b (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174685 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules/cxx-many-overloads.cpp')
-rw-r--r--test/Modules/cxx-many-overloads.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Modules/cxx-many-overloads.cpp b/test/Modules/cxx-many-overloads.cpp
new file mode 100644
index 0000000000..84e4140b93
--- /dev/null
+++ b/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>());
+}