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

Subversion Repositories openrisc

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

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

powered by: WebSVN 2.1.0

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