summaryrefslogtreecommitdiff
path: root/test/CXX/drs/dr10xx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/drs/dr10xx.cpp')
-rw-r--r--test/CXX/drs/dr10xx.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CXX/drs/dr10xx.cpp b/test/CXX/drs/dr10xx.cpp
index e11e796165e22..e1db9ef54adf8 100644
--- a/test/CXX/drs/dr10xx.cpp
+++ b/test/CXX/drs/dr10xx.cpp
@@ -12,6 +12,30 @@ namespace std {
};
}
+namespace dr1004 { // dr1004: 5
+ template<typename> struct A {};
+ template<typename> struct B1 {};
+ template<template<typename> class> struct B2 {};
+ template<typename X> void f(); // expected-note {{[with X = dr1004::A<int>]}}
+ template<template<typename> class X> void f(); // expected-note {{[with X = A]}}
+ template<template<typename> class X> void g(); // expected-note {{[with X = A]}}
+ template<typename X> void g(); // expected-note {{[with X = dr1004::A<int>]}}
+ struct C : A<int> {
+ B1<A> b1a;
+ B2<A> b2a;
+ void h() {
+ f<A>(); // expected-error {{ambiguous}}
+ g<A>(); // expected-error {{ambiguous}}
+ }
+ };
+
+ // This example (from the standard) is actually ill-formed, because
+ // name lookup of "T::template A" names the constructor.
+ // FIXME: Only issue one diagnostic for this case.
+ template<class T, template<class> class U = T::template A> struct Third { }; // expected-error 2{{is a constructor name}}
+ Third<A<int> > t; // expected-note {{in instantiation of}} expected-note {{while substituting}} expected-note {{while checking}}
+}
+
namespace dr1048 { // dr1048: 3.6
struct A {};
const A f();