OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [enum_base.C] - Blame information for rev 318

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// { dg-options "-std=c++0x" }
2
 
3
typedef unsigned volatile long long uvlonglong;
4
 
5
enum E1 : char { };
6
enum E2 : signed const short { };
7
enum E3 : uvlonglong { };
8
enum E4 : char {
9
  val = 500 // { dg-error "too large" }
10
};
11
 
12
enum class E5 {
13
  val = (unsigned long long)-1 // { dg-error "too large" }
14
};
15
 
16
typedef float Float;
17
 
18
enum class E6 : Float { }; // { dg-error "must be an integral type" }
19
 
20
static_assert (sizeof(E1) == sizeof(char), "char-sized enum");
21
static_assert (sizeof(E2) == sizeof(signed short), "short-sized enum");
22
static_assert (sizeof(E3) == sizeof(unsigned long long),
23
               "long long-sized enum");
24
static_assert (sizeof(E4) == sizeof(char), "char-sized enum");
25
static_assert (sizeof(E5) == sizeof(int), "scoped enum with int size");

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.