summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/drs/dr10xx.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-01-18 19:19:22 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-01-18 19:19:22 +0000
commit11255ec7659cec933e0b0415c14d50ca80cb16cd (patch)
tree429cafd7000eed7d9e88ea3ae0a471ac8c26e4df /clang/test/CXX/drs/dr10xx.cpp
parent0de990da16c4aeed10612da9dd752fa28de5a007 (diff)
downloadbcm5719-llvm-11255ec7659cec933e0b0415c14d50ca80cb16cd.tar.gz
bcm5719-llvm-11255ec7659cec933e0b0415c14d50ca80cb16cd.zip
PR9551: Implement DR1004 (http://wg21.link/cwg1004).
This rule permits the injected-class-name of a class template to be used as both a template type argument and a template template argument, with no extra syntax required to disambiguate. llvm-svn: 292426
Diffstat (limited to 'clang/test/CXX/drs/dr10xx.cpp')
-rw-r--r--clang/test/CXX/drs/dr10xx.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/CXX/drs/dr10xx.cpp b/clang/test/CXX/drs/dr10xx.cpp
index e11e796165e..0ae55f5e07c 100644
--- a/clang/test/CXX/drs/dr10xx.cpp
+++ b/clang/test/CXX/drs/dr10xx.cpp
@@ -12,6 +12,29 @@ 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}}
+ }
+ };
+
+ // FIXME: Is this example (from the standard) really OK, or does name lookup
+ // of "T::template A" name the constructor?
+ template<class T, template<class> class U = T::template A> struct Third { };
+ Third<A<int> > t;
+}
+
namespace dr1048 { // dr1048: 3.6
struct A {};
const A f();
OpenPOWER on IntegriCloud