gcc/testsuite/g++.dg/cpp1z/ttp1.C
raw| 1 | // CWG 150: Matching of template template-arguments excludes compatible |
| 2 | // templates |
| 3 | |
| 4 | // { dg-options -fnew-ttp-matching } |
| 5 | |
| 6 | template<class T, class U = T> class B { /* ... */ }; |
| 7 | #if __cpp_variadic_templates |
| 8 | template <class ... Types> class C { /* ... */ }; |
| 9 | #endif |
| 10 | template<template<class> class P, class T> void f(P<T>); |
| 11 | |
| 12 | int main() |
| 13 | { |
| 14 | f(B<int>()); |
| 15 | f(B<int,float>()); // { dg-error "no match" } |
| 16 | #if __cpp_variadic_templates |
| 17 | f(C<int>()); |
| 18 | #endif |
| 19 | } |