Issue |
133235
|
Summary |
-Wmissing-prototypes regression from llvm19
|
Labels |
bug,
clang,
regression:19
|
Assignees |
|
Reporter |
gbMattN
|
With this reproducer
```
#include<cstdlib>
#pragma clang diagnostic error "-Wmissing-prototypes"
void operator delete( void* ptr, std::size_t size ) noexcept { /* Diagnostic expected */
(void) ptr; /* avoid unused warning */
(void) size;
}
int main(){
int* p = new int;
*p = 13;
delete p;
return 0;
}
```
In llvm18.1.8 you get the error
```
reproducer.cpp:6:6: error: no previous prototype for function 'operator delete' [-Werror,-Wmissing-prototypes]
6 | void operator delete( void* ptr, std::size_t size ) noexcept { /* Diagnostic expected */
| ^
reproducer.cpp:6:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
6 | void operator delete( void* ptr, std::size_t size ) noexcept { /* Diagnostic expected */
| ^
| static
1 error generated.
```
However from llvm19.1.0, this is no longer caught.
This bug also happens if you define `void operator delete(void*)` without the sized version
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs