https://bugs.llvm.org/show_bug.cgi?id=51765

            Bug ID: 51765
           Summary: The exception specification of a deallocation function
                    that is not explicitly specified is non-throwing
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

#include <iostream>
void operator delete(void*){}  // #1
int main(){

}

Clang rejects this example, whilst giving an error 

> function previously declared with an explicit exception specification 
> redeclared with an implicit exception specification 
> [-Werror,-Wimplicit-exception-spec-mismatch]

However, according to [except.spec#10]

> A deallocation function with no explicit noexcept-specifier has a 
> non-throwing exception specification.

That means the signature of the declaration at `#1` is identical to `void
operator delete(void*) noexcept` 

[new.delete.single] permits that  

> void operator delete(void* ptr) noexcept;
> Replaceable: A C++ program may define functions with any of these function 
> signatures, and thereby displace the default versions defined by the C++ 
> standard library.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to