annotate gcc/testsuite/g++.dg/template/nontype6.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do compile }
kono
parents:
diff changeset
2 // Origin: <v dot haisman at sh dot cvut dot cz>
kono
parents:
diff changeset
3 // PR c++/13957: Improved error message for type in template (when non-type
kono
parents:
diff changeset
4 // is expected).
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 template <class T>
kono
parents:
diff changeset
7 struct A
kono
parents:
diff changeset
8 {
kono
parents:
diff changeset
9 typedef int type;
kono
parents:
diff changeset
10 };
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 template <class T>
kono
parents:
diff changeset
13 void func(void)
kono
parents:
diff changeset
14 {
kono
parents:
diff changeset
15 (void)A<T>::type(); // { dg-error "non-type" "non-type" }
kono
parents:
diff changeset
16 // { dg-message "if a type" "note" { target *-*-* } .-1 }
kono
parents:
diff changeset
17 }
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 template void func<float>(void); // { dg-message "required from here" }