URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 338 |
// Positive test for defaulted/deleted fns
|
// Positive test for defaulted/deleted fns
|
// { dg-do run }
|
// { dg-do run }
|
// { dg-options "-std=c++0x" }
|
// { dg-options "-std=c++0x" }
|
|
|
struct A
|
struct A
|
{
|
{
|
int i;
|
int i;
|
A() = default;
|
A() = default;
|
A(const A&) = delete;
|
A(const A&) = delete;
|
A& operator=(const A&) = default;
|
A& operator=(const A&) = default;
|
~A();
|
~A();
|
};
|
};
|
|
|
A::~A() = default;
|
A::~A() = default;
|
|
|
void f() = delete;
|
void f() = delete;
|
|
|
struct B
|
struct B
|
{
|
{
|
int i;
|
int i;
|
B() = default;
|
B() = default;
|
};
|
};
|
|
|
int main()
|
int main()
|
{
|
{
|
A a1, a2;
|
A a1, a2;
|
B b = {1};
|
B b = {1};
|
a1 = a2;
|
a1 = a2;
|
}
|
}
|
|
|
// fns defaulted in class defn are trivial
|
// fns defaulted in class defn are trivial
|
struct C
|
struct C
|
{
|
{
|
C() = default;
|
C() = default;
|
C(const C&) = default;
|
C(const C&) = default;
|
C& operator=(const C&) = default;
|
C& operator=(const C&) = default;
|
~C() = default;
|
~C() = default;
|
};
|
};
|
|
|
union U
|
union U
|
{
|
{
|
C c;
|
C c;
|
};
|
};
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.