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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [ext/] [underlying_type5.C] - Blame information for rev 696

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// { dg-options "-std=c++0x" }
3
 
4
template
5
  struct is_same
6
  { static const bool value = false; };
7
 
8
template
9
  struct is_same
10
  { static const bool value = true; };
11
 
12
enum E1 : unsigned { };
13
enum E2 : char { };
14
enum class E3 { };
15
enum class E4 : unsigned char { c = 1 };
16
enum class E5 : int { a = -1, b = 1 };
17
enum class E6 : long { c = __LONG_MAX__ };
18
 
19
typedef __underlying_type(E1) UTE1;
20
typedef __underlying_type(E2) UTE2;
21
typedef __underlying_type(E3) UTE3;
22
typedef __underlying_type(E4) UTE4;
23
typedef __underlying_type(E5) UTE5;
24
typedef __underlying_type(E6) UTE6;
25
 
26
template
27
  struct underlying_type
28
  { typedef __underlying_type(T) type; };
29
 
30
static_assert(is_same::type, UTE1>::value, "Error");
31
static_assert(is_same::type, UTE2>::value, "Error");
32
static_assert(is_same::type, UTE3>::value, "Error");
33
static_assert(is_same::type, UTE4>::value, "Error");
34
static_assert(is_same::type, UTE5>::value, "Error");
35
static_assert(is_same::type, UTE6>::value, "Error");
36
 
37
static_assert(is_same::type, unsigned>::value, "Error");
38
static_assert(is_same::type, char>::value, "Error");
39
static_assert(is_same::type, int>::value, "Error");
40
static_assert(is_same::type,
41
                      unsigned char>::value, "Error");
42
static_assert(is_same::type, int>::value, "Error");
43
static_assert(is_same::type, long>::value, "Error");

powered by: WebSVN 2.1.0

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