summaryrefslogtreecommitdiff
path: root/test/CXX/temp/temp.decls
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-02-15 21:53:07 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-02-15 21:53:07 +0000
commit264d6736fec09b767e55b8671afb84b7fe0d051e (patch)
tree13d846f8b06e63df5862521eea22b79e9d627fa8 /test/CXX/temp/temp.decls
parentb872cddd89f6b9666159b083dbe84ff01eb48f85 (diff)
downloadclang-264d6736fec09b767e55b8671afb84b7fe0d051e.tar.gz
Fix implementation of [temp.local]p4.
When a template-name is looked up, we need to give injected-class-name declarations of class templates special treatment, as they denote a template rather than a type. Previously we achieved this by applying a filter to the lookup results after completing name lookup, but that is incorrect in various ways, not least of which is that it lost all information about access and how members were named, and the filtering caused us to generally lose all ambiguity errors between templates and non-templates. We now preserve the lookup results exactly, and the few places that need to map from a declaration found by name lookup into a declaration of a template do so explicitly. Deduplication of repeated lookup results of the same injected-class-name declaration is done by name lookup instead of after the fact. This reinstates r354091, which was previously reverted in r354097 because it exposed bugs in lldb and compiler-rt. Those bugs were fixed in r354173 and r354174 respectively. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354176 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/temp/temp.decls')
-rw-r--r--test/CXX/temp/temp.decls/temp.friend/p1.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/CXX/temp/temp.decls/temp.friend/p1.cpp b/test/CXX/temp/temp.decls/temp.friend/p1.cpp
index 849728a448..ab1b9f7a73 100644
--- a/test/CXX/temp/temp.decls/temp.friend/p1.cpp
+++ b/test/CXX/temp/temp.decls/temp.friend/p1.cpp
@@ -380,10 +380,10 @@ template <class T> struct A {
namespace test18 {
namespace ns1 { template <class T> struct foo {}; } // expected-note{{candidate ignored: not a function template}}
namespace ns2 { void foo() {} } // expected-note{{candidate ignored: not a function template}}
-using ns1::foo;
-using ns2::foo;
+using ns1::foo; // expected-note {{found by name lookup}}
+using ns2::foo; // expected-note {{found by name lookup}}
template <class T> class A {
- friend void foo<T>() {} // expected-error{{no candidate function template was found for dependent friend function template specialization}}
+ friend void foo<T>() {} // expected-error {{ambiguous}} expected-error{{no candidate function template was found for dependent friend function template specialization}}
};
}