diff options
author | David Majnemer <david.majnemer@gmail.com> | 2013-10-20 05:40:29 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2013-10-20 05:40:29 +0000 |
commit | ad51f1bc70f5342ae32e702800eb817e4bef8c04 (patch) | |
tree | 170611a74bc59127b2a644d4ba7d9f389a041fa6 /clang/test/SemaCXX/new-delete.cpp | |
parent | a5906f06aacd147608a1e838b7dd6e7293b09425 (diff) | |
download | bcm5719-llvm-ad51f1bc70f5342ae32e702800eb817e4bef8c04.tar.gz bcm5719-llvm-ad51f1bc70f5342ae32e702800eb817e4bef8c04.zip |
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
Diffstat (limited to 'clang/test/SemaCXX/new-delete.cpp')
-rw-r--r-- | clang/test/SemaCXX/new-delete.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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() |