aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/nontype6.C
blob: b51474f83ea488f1fc614a99273c4a75b7ded0b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// { dg-do compile }
// Origin: <v dot haisman at sh dot cvut dot cz>
// PR c++/13957: Improved error message for type in template (when non-type
//  is expected).

template <class T>
struct A
{
  typedef int type;
};

template <class T>
void func(void)
{
  (void)A<T>::type();	 // { dg-error "non-type" "non-type" }
// { dg-message "if a type" "note" { target *-*-* } 15 }
}

template void func<float>(void);    // { dg-message "required from here" }