aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/parse/template25.C
blob: 03017ab3a636cc7f0a575eb76a0c7ea9bcf47ac2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// PR c++/22318. Improve diagnostic for local template declaration.
// { dg-do compile }
void f(void)
{
  template<typename T> class A /* { dg-error "a template declaration cannot appear at block scope" } */
  {
  };
}

void g(void)
{
  template f<int>(); /* { dg-error "expected primary-expression" "primary-expression" } */
}