summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/basic
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-03-26 23:10:15 +0000
committerJohn McCall <rjmccall@apple.com>2010-03-26 23:10:15 +0000
commit30837102a2ef32218c5d95d372b9ab3561733b6c (patch)
tree79c89310337a2a9ad971687a95432db2be69f154 /clang/test/CXX/basic
parent4667effa8bdd9df81e51e1e3219c7cd0f525af58 (diff)
downloadbcm5719-llvm-30837102a2ef32218c5d95d372b9ab3561733b6c.tar.gz
bcm5719-llvm-30837102a2ef32218c5d95d372b9ab3561733b6c.zip
Put function templates instantiated from friend declarations in the correct
lexical context. This is required for ADL to work properly; fixes PR6716. llvm-svn: 99665
Diffstat (limited to 'clang/test/CXX/basic')
-rw-r--r--clang/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp b/clang/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp
index b59e6ca320e..df3429ef31c 100644
--- a/clang/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp
+++ b/clang/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp
@@ -40,3 +40,15 @@ namespace Test {
D::D() + D::D(); // expected-error {{ invalid operands to binary expression ('D::D' and 'D::D') }}
}
}
+
+// PR6716
+namespace test1 {
+ template <class T> class A {
+ template <class U> friend void foo(A &, U); // expected-note {{not viable: 1st argument ('A<int> const') would lose const qualifier}}
+ };
+
+ void test() {
+ const A<int> a;
+ foo(a, 10); // expected-error {{no matching function for call to 'foo'}}
+ }
+}
OpenPOWER on IntegriCloud