aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiate-anonymous-union.cpp
blob: 375c1da3ca59a3ed93d90178ae30b3f11f07102a (plain) (blame)
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
// RUN: clang-cc -fsyntax-only %s -Wall

template <typename T> class A { struct { }; };

A<int> a0;

template <typename T> struct B {
  union {
    int a;
    void* b;
  };
    
  void f() {
    a = 10;
    b = 0;
  }
};

B<int> b0;

template <typename T> struct C {
  union {
    int a;
    void* b;
  };

  C(int a) : a(a) { }
  C(void* b) : b(b) { }
};

C<int> c0(0);