Files
clang-p2996/clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp
Richard Smith bdd146435f Add implicit declarations of allocation functions when looking them up for
redeclaration, not just when looking them up for a use -- we need the implicit
declaration to appropriately check various properties of them (notably, whether
they're deleted).

llvm-svn: 200729
2014-02-04 01:14:30 +00:00

13 lines
465 B
C++

// RUN: %clang_cc1 -fsyntax-only -verify %s
struct A {
void operator delete(void*);
};
namespace NS {
void operator delete(void *); // expected-error {{'operator delete' cannot be declared inside a namespace}}
}
static void operator delete(void *); // expected-error {{follows non-static declaration}} expected-note {{implicit}}
static void operator delete(void *, int, int); // expected-error {{'operator delete' cannot be declared static in global scope}}