summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/cxx0x-nontrivial-union.cpp
blob: 666e64be66abd0b8cfdcc850b1cd0c37f37e1b5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s

struct non_trivial {
  non_trivial();
  non_trivial(const non_trivial&);
  non_trivial& operator = (const non_trivial&);
  ~non_trivial();
};

union u {
  non_trivial nt;
};

union bad {
  static int i; // expected-error {{static data member}}
};

struct s {
  union {
    non_trivial nt;
  };
};
OpenPOWER on IntegriCloud