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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [init/] [elide2.C] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// PR c++/8674
2
 
3
// Bug: Since B().a is an rvalue, we tried to treat it like a TARGET_EXPR
4
// and elide the copy.  But that produces a bitwise copy, which causes us
5
// to abort in cp_expr_size.
6
 
7
// Test that we actually run the A copy constructor when calling f().
8
 
9
// { dg-do run }
10
 
11
int c;
12
 
13
struct A
14
{
15
  A () { ++c; }
16
  A (const A&) { ++c; }
17
};
18
 
19
struct B
20
{
21
  A a;
22
};
23
 
24
void f (A) { }
25
 
26
int main ()
27
{
28
  f (B().a);
29
  return c < 2;
30
}

powered by: WebSVN 2.1.0

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