summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/drs/dr13xx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CXX/drs/dr13xx.cpp')
-rw-r--r--clang/test/CXX/drs/dr13xx.cpp78
1 files changed, 0 insertions, 78 deletions
diff --git a/clang/test/CXX/drs/dr13xx.cpp b/clang/test/CXX/drs/dr13xx.cpp
index b9be5ca821c..28bebcbb607 100644
--- a/clang/test/CXX/drs/dr13xx.cpp
+++ b/clang/test/CXX/drs/dr13xx.cpp
@@ -174,81 +174,3 @@ namespace dr1359 { // dr1359: 3.5
constexpr Y y = Y(); // expected-error {{no matching}}
#endif
}
-
-namespace dr1391 { // dr1391: partial
- struct A {}; struct B : A {};
- template<typename T> struct C { C(int); typename T::error error; }; // expected-error 2{{'::'}}
- template<typename T> struct D {};
-
- // No deduction is performed for parameters with no deducible template-parameters, therefore types do not need to match.
- template<typename T> void a(T, int T::*);
- void test_a(int A::*p) { a(A(), p); } // ok, type of second parameter does not need to match
-
- namespace dr_example_1 {
- template<typename T, typename U> void f(C<T>);
- template<typename T> void f(D<T>);
-
- void g(D<int> d) {
- f(d); // ok, first 'f' eliminated by deduction failure
- f<int>(d); // ok, first 'f' eliminated because 'U' cannot be deduced
- }
- }
-
- namespace dr_example_2 {
- template<typename T> typename C<T>::error f(int, T);
- template<typename T> T f(T, T);
-
- void g(A a) {
- f(a, a); // ok, no conversion from A to int for first parameter of first candidate
- }
- }
-
- namespace std_example {
- template<typename T> struct Z {
- typedef typename T::x xx;
- };
- template<typename T> typename Z<T>::xx f(void *, T);
- template<typename T> void f(int, T);
- struct A {} a;
- void g() { f(1, a); }
- }
-
- template<typename T> void b(C<int> ci, T *p);
- void b(...);
- void test_b() {
- b(0, 0); // ok, deduction fails prior to forming a conversion sequence and instantiating C<int>
- // FIXME: The "while substituting" note should point at the overload candidate.
- b<int>(0, 0); // expected-note {{instantiation of}} expected-note {{while substituting}}
- }
-
- template<typename T> struct Id { typedef T type; };
- template<typename T> void c(T, typename Id<C<T> >::type);
- void test_c() {
- // Implicit conversion sequences for dependent types are checked later.
- c(0.0, 0); // expected-note {{instantiation of}}
- }
-
- namespace partial_ordering {
- // FIXME: Second template should be considered more specialized because non-dependent parameter is ignored.
- template<typename T> int a(T, short) = delete; // expected-error 0-1{{extension}} expected-note {{candidate}}
- template<typename T> int a(T*, char); // expected-note {{candidate}}
- int test_a = a((int*)0, 0); // FIXME: expected-error {{ambiguous}}
-
- // FIXME: Second template should be considered more specialized:
- // deducing #1 from #2 ignores the second P/A pair, so deduction succeeds,
- // deducing #2 from #1 fails to deduce T, so deduction fails.
- template<typename T> int b(T, int) = delete; // expected-error 0-1{{extension}} expected-note {{candidate}}
- template<typename T, typename U> int b(T*, U); // expected-note {{candidate}}
- int test_b = b((int*)0, 0); // FIXME: expected-error {{ambiguous}}
-
- // Unintended consequences: because partial ordering does not consider
- // explicit template arguments, and deduction from a non-dependent type
- // vacuously succeeds, a non-dependent template is less specialized than
- // anything else!
- // According to DR1391, this is ambiguous!
- template<typename T> int c(int);
- template<typename T> int c(T);
- int test_c1 = c(0); // ok
- int test_c2 = c<int>(0); // FIXME: apparently ambiguous
- }
-}
OpenPOWER on IntegriCloud