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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [rv-cast3.C] - Rev 774

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

// PR c++/51406
// { dg-do run { target c++11 } }

extern "C" int printf(const char *,...);
extern "C" void abort();

struct A { int a; A() : a(1) {} };
struct B { int b; B() : b(2) {} };
struct X : A, B {};

int main() {
    X x;
    int a=static_cast<A&&>(x).a;
    int b=static_cast<B&&>(x).b;
    // printf ("%d %d\n", a, b);
    if (a!=1 || b!=2) abort();
}

Go to most recent revision | 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.