blob: 63445ca0583fa76ea90225e43b9eaf95ad962452 [file] [log] [blame]
Richard Smith762bb9d2011-10-13 22:29:44 +00001// RUN: %clang_cc1 -fsyntax-only -pedantic -std=c++11 -verify -triple x86_64-apple-darwin %s
Douglas Gregora61b3e72010-12-01 17:42:47 +00002
3enum E {};
4
Richard Smith61802452011-12-22 02:22:31 +00005struct Z {};
Douglas Gregora61b3e72010-12-01 17:42:47 +00006typedef int Integer;
7
8struct X {
9 enum E : 1;
10 enum E : Z; // expected-error{{invalid underlying type}}
11 enum E2 : int;
12 enum E3 : Integer;
13};
14
15struct Y {
16 enum E : int(2);
Richard Smith282e7e62012-02-04 09:53:13 +000017 enum E : Z(); // expected-error{{integral constant expression must have integral or unscoped enumeration type, not 'Z'}}
Douglas Gregora61b3e72010-12-01 17:42:47 +000018};