blob: b343970336f8d0033d5038245ca66a757249aefa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
// { dg-do compile }
// Contributed by Volker Reichelt <reichelt at gcc dot gnu dot org>
// PR c++/14008: Improve diagnostic on invalid types in declarators.
namespace N
{
template<int> struct A {};
struct C {};
int K;
}
N::A f2; // { dg-error "without an argument list" }
N::INVALID f3; // { dg-error "in namespace 'N' does not name a type" }
N::C::INVALID f4; // { dg-error "in class 'N::C' does not name a type" }
N::K f6; // { dg-error "in namespace 'N' does not name a type" }
typename N::A f7; // { dg-error "without an argument list|outside of template" }
struct B
{
N::A f2; // { dg-error "without an argument list" }
N::INVALID f3; // { dg-error "in namespace 'N' does not name a type" }
N::C::INVALID f4; // { dg-error "in class 'N::C' does not name a type" }
N::K f6; // { dg-error "in namespace 'N' does not name a type" }
typename N::A f7; // { dg-error "without an argument list|outside of template" }
};
template <int>
struct C
{
N::A f2; // { dg-error "without an argument list" }
N::INVALID f3; // { dg-error "in namespace 'N' does not name a type" }
N::C::INVALID f4; // { dg-error "in class 'N::C' does not name a type" }
N::K f6; // { dg-error "in namespace 'N' does not name a type" }
typename N::A f7; // { dg-error "without an argument list" }
};
// { dg-bogus "" "bogus excess errors in declaration" { xfail *-*-* } 16 }
|