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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [cond6.C] - Rev 823

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

// { dg-do assemble  }
// Test that the result of `x ? const E : E' is an E rvalue.
// Contributed by Jason Merrill <jason@cygnus.com>

enum E { a };

bool b;

int main ()
{
  E e1 = a;
  const E &er = e1;
  E e2 = b ? er : a;            // OK
  const E* ep = &(b ? er : a);  // { dg-error "" } non-lvalue
}

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.