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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [initlist22.C] - Rev 693

Compare with Previous | Blame | View Log

// Core issue 934
// { dg-options "-std=c++0x" }

int i;

int& r1{ i };                   // OK, direct binding
int&& r2{ i };                  // { dg-error "" } binding && to lvalue

int& r3{ };                     // { dg-error "" } reference to temporary
int&& r4{ };                    // OK, reference to temporary

struct A { int i; } a;

A& r5 { i };                    // { dg-error "" } reference to temporary
A&& r6 { i };                   // OK, aggregate initialization of temporary
A& r7 { a };                    // { dg-error "" } invalid aggregate initializer for A
A&& r8 { a };                   // { dg-error "" } invalid aggregate initializer for A

struct B { B(int); int i; } b(0);

B& r9 { i };                    // { dg-error "" } reference to temporary
B&& r10 { i };                  // OK, make temporary with B(int) constructor
B& r11 { b };                   // { dg-error "" } reference to temporary
B&& r12 { b };                  // OK, make temporary with copy constructor

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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