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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [init/] [pr25811-3.C] - Blame information for rev 715

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
 
3
struct A { int const i; };
4
struct B { int& i; };
5
struct C { int i; };
6
 
7
template< class T >
8
class is_constructible_via_new_without_initializer
9
{
10
    template class size {};
11
 
12
    typedef char yes_type;
13
    struct no_type { char data[2]; };
14
 
15
    template 
16
    static yes_type sfinae (size< sizeof (new U) >*);
17
 
18
    template 
19
    static no_type sfinae (...);
20
 
21
public:
22
  static const bool value = sizeof (sfinae(0)) == sizeof (yes_type);
23
};
24
 
25
#define JOIN( X, Y ) DO_JOIN( X, Y )
26
#define DO_JOIN( X, Y ) DO_JOIN2(X,Y)
27
#define DO_JOIN2( X, Y ) X##Y
28
 
29
#ifdef __GXX_EXPERIMENTAL_CXX0X__
30
#  define STATIC_ASSERT(Expr) static_assert(Expr, #Expr)
31
#else
32
#  define STATIC_ASSERT(Expr) int JOIN(a,__LINE__)[Expr? 1 : -1]
33
#endif
34
 
35
STATIC_ASSERT (!is_constructible_via_new_without_initializer::value);
36
STATIC_ASSERT (!is_constructible_via_new_without_initializer::value);
37
STATIC_ASSERT (is_constructible_via_new_without_initializer::value);
38
 

powered by: WebSVN 2.1.0

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