summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/parse/template25.C
blob: 8ffcd121e1850a0b287a6edf500c59cbc05bba73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// 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" } */
  /* { dg-error "expected ';'" "" { target *-*-* } 12 } */
}