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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [constexpr-data2.C] - Blame information for rev 774

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=gnu++0x" }
3
 
4
template
5
  struct A3
6
  {
7
    typedef _Tp value_type;
8
    typedef A3 type;
9
 
10
    static constexpr value_type value = v;
11
 
12
    constexpr operator value_type() { return value; }
13
  };
14
 
15
// Partial specialization.
16
template
17
  struct A3<_Tp*, v>
18
  {
19
    typedef _Tp* value_type;
20
    typedef A3 type;
21
 
22
    static constexpr value_type value = v;
23
 
24
    constexpr operator value_type() { return value; }
25
  };
26
 
27
// Explicit specialization.
28
template<>
29
  struct A3
30
  {
31
    typedef unsigned short value_type;
32
    typedef A3 type;
33
 
34
    static constexpr value_type value = 0;
35
 
36
    constexpr operator value_type() { return value; }
37
  };
38
 
39
// Explicitly instantiate.
40
template struct A3;
41
 
42
// Extern explicitly instantiate.
43
extern template struct A3;
44
 
45
// Use.
46
A3 a31;
47
A3 a32;         // { dg-warning "overflow" }

powered by: WebSVN 2.1.0

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