blob: 63445ca0583fa76ea90225e43b9eaf95ad962452 [file] [log] [blame]
Richard Smith9ca5c422011-10-13 22:29:44 +00001// RUN: %clang_cc1 -fsyntax-only -pedantic -std=c++11 -verify -triple x86_64-apple-darwin %s
Douglas Gregord1f69f62010-12-01 17:42:47 +00002
3enum E {};
4
Richard Smithcc36f692011-12-22 02:22:31 +00005struct Z {};
Douglas Gregord1f69f62010-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 Smithf4c51d92012-02-04 09:53:13 +000017 enum E : Z(); // expected-error{{integral constant expression must have integral or unscoped enumeration type, not 'Z'}}
Douglas Gregord1f69f62010-12-01 17:42:47 +000018};