Clang Project

clang_source_code/test/CXX/temp/temp.decls/temp.class.spec/temp.class.spec.mfunc/p1-neg.cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3template<typename T, int N>
4struct A;
5
6template<typename T> // expected-note{{previous template declaration}}
7struct A<T*, 2> {
8  void f0();
9  void f1();
10  void f2();
11};
12
13template<>
14struct A<int, 1> {
15  void g0();
16};
17
18// FIXME: We should probably give more precise diagnostics here, but the
19// diagnostics we give aren't terrible.
20// FIXME: why not point to the first parameter that's "too many"?
21template<typename T, int N> // expected-error{{too many template parameters}}
22void A<T*, 2>::f0() { }
23
24template<typename T, int N>
25void A<T, N>::f1() { } // expected-error{{out-of-line definition}}
26