| 1 | // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s |
| 2 | |
| 3 | void f(); |
| 4 | |
| 5 | // Test typeof(expr) canonicalization |
| 6 | template<typename T, T N> |
| 7 | void f0(T x, decltype(f(N, x)) y) { } // expected-note{{previous}} |
| 8 | |
| 9 | template<typename T, T N> |
| 10 | void f0(T x, decltype((f)(N, x)) y) { } |
| 11 | |
| 12 | template<typename U, U M> |
| 13 | void f0(U u, decltype(f(M, u))) { } // expected-error{{redefinition}} |
| 14 | |
| 15 | // PR12438: Test sizeof...() canonicalization |
| 16 | template<int> struct N {}; |
| 17 | |
| 18 | template<typename...T> |
| 19 | N<sizeof...(T)> f1() {} // expected-note{{previous}} |
| 20 | |
| 21 | template<typename, typename...T> |
| 22 | N<sizeof...(T)> f1() {} |
| 23 | |
| 24 | template<class...U> |
| 25 | N<sizeof...(U)> f1() {} // expected-error{{redefinition}} |
| 26 | |