summaryrefslogtreecommitdiff
path: root/test/CXX/temp/temp.decls
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-02-15 00:29:04 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-02-15 00:29:04 +0000
commit0068e5bc959c7fea357d598d2ab004f0cf6b1fac (patch)
treedf8632cecaff2ed1fe0e602d0863930d8800d98d /test/CXX/temp/temp.decls
parentd1f4353f6e59e74948fb8442a8fda9b0bf379700 (diff)
downloadclang-0068e5bc959c7fea357d598d2ab004f0cf6b1fac.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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354091 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}}
};
}