From ad51f1bc70f5342ae32e702800eb817e4bef8c04 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Sun, 20 Oct 2013 05:40:29 +0000 Subject: Sema: Diagnose global replacement functions declared as inline This fixes PR17591. N.B. This actually goes beyond what the standard mandates by requiring the restriction to hold for declarations instead of definitions. This is believed to be a defect in the standard and an LWG issue has been submitted. llvm-svn: 193044 --- clang/test/SemaCXX/new-delete.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/test/SemaCXX/new-delete.cpp') diff --git a/clang/test/SemaCXX/new-delete.cpp b/clang/test/SemaCXX/new-delete.cpp index 898c6e0879a..de26cad62e1 100644 --- a/clang/test/SemaCXX/new-delete.cpp +++ b/clang/test/SemaCXX/new-delete.cpp @@ -24,6 +24,8 @@ void* operator new(size_t, int*); // expected-note 3 {{candidate}} void* operator new(size_t, float*); // expected-note 3 {{candidate}} void* operator new(size_t, S); // expected-note 2 {{candidate}} +inline void operator delete(void *); // expected-error {{'operator delete' cannot be declared 'inline'}} + struct foo { }; void good_news() -- cgit v1.2.3