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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [tc1/] [dr147.C] - Blame information for rev 154

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

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do compile }
2
// Origin: Giovanni Bajo 
3
// DR147: Naming the constructor (PR 11764)
4
 
5
namespace N1 {
6
 
7
struct A { A(); };
8
struct B: public A { B(); };
9
 
10
A::A() { }
11
B::B() { }
12
 
13
B::A ba;
14
A::A a; // { dg-error "" "the injected-class-name can never be found through qualified lookup" { xfail *-*-* } }
15
 
16
}
17
 
18
namespace N2 {
19
 
20
// This is nasty: if we allowed the injected-class-name to be looked as a
21
//  qualified type, then the following code would be well-formed. Basically
22
//  the last line is defining the static member (with redundant parenthesis).
23
// Instead, it should be rejected as a malformed constructor declaration.
24
 
25
template  struct A {
26
  template  A(T2);
27
  static A x;
28
};
29
template<> A::A(A::x);  // { dg-error "" "this is an invalid declaration of the constructor" { xfail *-*-* } }
30
 
31
}

powered by: WebSVN 2.1.0

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