summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/pr36999.C
blob: ce2286efcf4fd721f2d7c30f729d4379dc432a00 (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
38
39
40
/* PR36999: Erroneous "does not declare anything" warnings.  */
/* { dg-do compile } */

class C1 {
 public: class C2 { };
};

void cf1 (class C1::C2, void*);  // { dg-bogus "does not declare anything" }
void cf2 (void*, class C1::C2);
void cf3 (C1::C2, void*);

namespace N {

enum E1 { foo }; 
enum E2 { bar }; 

template <class X>
class TC1 { };

template <class T, class U>
class TC2 : public TC1<T> { };

}

void
tcf1 (N::TC2<enum N::E1, void*> *arg1,  // { dg-bogus "does not declare anything" }
      N::TC2<void*, enum N::E1> *arg2,
      N::TC2<N::E1, void*> *arg3)
{
}

void *
tcf2 (void *x)
{
  return (void *)
    (N::TC2<enum N::E1, void*> *)  // { dg-bogus "does not declare anything" }
    (N::TC2<void*, enum N::E1> *)
    (N::TC2<N::E1, void*> *)
    x;
}