view gcc/testsuite/g++.old-deja/g++.law/friend1.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

// { dg-do assemble  }
// GROUPS passed friends
// friends file
// From: rwave!myersn%rwave.roguewave@cs.orst.edu (Nathan Myers)
// Date:     Thu, 17 Dec 92 16:33 PST
// Subject:  2.3.2: friend decl of new confuses constructor
// Message-ID: <m0n2Vec-0000GrC@rwave.roguewave.com>

#include <stddef.h>
#include <new>
struct Foo {
#if __cplusplus <= 199711L
  friend void* operator new(size_t) throw (std::bad_alloc);
#else
  friend void* operator new(size_t);
#endif
  friend void operator delete(void*) throw ();
  Foo();
  ~Foo();
};
Foo::Foo() { }
Foo::~Foo() { }