Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -pedantic -std=c++11 -verify -triple x86_64-apple-darwin %s |
Douglas Gregor | a61b3e7 | 2010-12-01 17:42:47 +0000 | [diff] [blame] | 2 | |
| 3 | enum E {}; |
| 4 | |
Richard Smith | 6180245 | 2011-12-22 02:22:31 +0000 | [diff] [blame] | 5 | struct Z {}; |
Douglas Gregor | a61b3e7 | 2010-12-01 17:42:47 +0000 | [diff] [blame] | 6 | typedef int Integer; |
| 7 | |
| 8 | struct X { |
| 9 | enum E : 1; |
| 10 | enum E : Z; // expected-error{{invalid underlying type}} |
| 11 | enum E2 : int; |
| 12 | enum E3 : Integer; |
| 13 | }; |
| 14 | |
| 15 | struct Y { |
| 16 | enum E : int(2); |
Richard Smith | 282e7e6 | 2012-02-04 09:53:13 +0000 | [diff] [blame] | 17 | enum E : Z(); // expected-error{{integral constant expression must have integral or unscoped enumeration type, not 'Z'}} |
Douglas Gregor | a61b3e7 | 2010-12-01 17:42:47 +0000 | [diff] [blame] | 18 | }; |