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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [other/] [abstract2.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// Contributed by Gabriel Dos Reis 
3
// PR c++/2204: Check for parameters of abstract type in function declarations.
4
 
5
namespace N1 {
6
  struct X;
7
 
8
  struct Y1 {
9
    void g(X parm1);         // { dg-error "abstract" }
10
    void g(X parm2[2]);      // { dg-error "abstract" }
11
    void g(X (*parm3)[2]);   // { dg-error "abstract" }
12
  };
13
 
14
 
15
  template 
16
  struct Y2 {
17
    void g(X parm4);         // { dg-error "abstract" }
18
    void g(X parm5[2]);      // { dg-error "abstract" }
19
    void g(X (*parm6)[2]);   // { dg-error "abstract" }
20
  };
21
 
22
  struct X {  // { dg-message "note" }
23
    virtual void xfunc(void) = 0;  // { dg-message "note" }
24
  };
25
}
26
 
27
namespace N2 {
28
  struct X1 { // { dg-message "note" }
29
    virtual void xfunc(void) = 0;  // { dg-message "note" }
30
    void g(X1 parm7);        // { dg-error "abstract" }
31
    void g(X1 parm8[2]);     // { dg-error "abstract" }
32
    void g(X1 (*parm9)[2]);  // { dg-error "abstract" }
33
  };
34
 
35
  template 
36
  struct X2 { // { dg-message "note" }
37
    virtual void xfunc(void) = 0; // { dg-message "note" }
38
    void g(X2 parm10);        // { dg-error "abstract" }
39
    void g(X2 parm11[2]);     // { dg-error "abstract" }
40
    void g(X2 (*parm12)[2]);  // { dg-error "abstract" }
41
  };
42
}
43
 
44
namespace N3 {
45
  struct X { // { dg-message "note" "" }
46
    virtual void xfunc(void) = 0;  // { dg-message "note" }
47
  };
48
  void g(X parm13);          // { dg-error "abstract" }
49
  void g(X parm14[2]);       // { dg-error "abstract" }
50
  void g(X (*parm15)[2]);    // { dg-error "abstract" }
51
 
52
  template 
53
  void g(X parm16);          // { dg-error "abstract" }
54
  template 
55
  void g(X parm17[2]);       // { dg-error "abstract" }
56
  template 
57
  void g(X (*parm18)[2]);    // { dg-error "abstract" }
58
}

powered by: WebSVN 2.1.0

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