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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.bugs/] [900519_09.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
// g++ 1.37.1 bug 900519_09
3
 
4
// g++ allows the allocation of const objects via operator new even when
5
// these uses of operator new do not include initializations.
6
 
7
// This is inconsistant within the restrictions placed on the construction
8
// of class, struct, and union types which have constant members.
9
 
10
// Since there is no completely valid way of initializing such objects
11
// after the invocation of new, these cases should all be illegal.
12
 
13
// keywords: operator new, initialization, const qualifier
14
 
15
struct struct_0 {
16
  int member;
17
};
18
 
19
typedef const int const_int;
20
typedef const struct struct_0 const_struct_0;
21
 
22
void test ()
23
{
24
  new const int;                // { dg-error "" }
25
  new const_int;                // { dg-error "" }
26
  new const struct_0;           // { dg-error "" }
27
  new const_struct_0;           // { dg-error "" }
28
}
29
 
30
int main () { return 0; }

powered by: WebSVN 2.1.0

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