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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.oliva/] [delete1.C] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
// { dg-do assemble  }
2
 
3
// Copyright (C) 1999, 2001 Free Software Foundation
4
 
5
// by Alexandre Oliva 
6
// simplified from bug report by K. Haley 
7
// based on analysis by Martin v. Loewis
8
 
9
// [class.dtor]/11: delete must be implicitly checked for
10
// accessibility only in the definition of virtual destructors,
11
// implicitly defined or not.
12
 
13
struct foo {
14
  foo() {}
15
private:
16
  void operator delete(void *) {} // { dg-error "" } private
17
} foo_;
18
 
19
struct bar : foo {
20
  ~bar() {
21
    delete this; // { dg-error "" } delete is private
22
    // An implicit invocation of delete is emitted in destructors, but
23
    // it should only be checked in virtual destructors
24
  } // { dg-bogus "" } not virtual
25
} bar_;
26
 
27
struct baz : foo {
28
  virtual ~baz() {} // { dg-error "" } delete is private in vdtor
29
} baz_;
30
 
31
struct bad : baz {} bad_; // { dg-error "" } delete is private in vdtor

powered by: WebSVN 2.1.0

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