ziqingluo-90 wrote:
> Here's the reduced code:
>
> ```
> enum errc { not_a_directory };
> namespace detail {
> struct ErrorHandler {
> ErrorHandler(char *, int *, int *, int *);
> __attribute__((__format__(__printf__, 3, 4))) void report(errc, char *);
> };
> } // namespace detail
> using detail::ErrorHandler;
> int __create_directory_ec, __create_directory_p,
> __create_directory_attributes;
> void __create_directory() {
> ErrorHandler err("", &__create_directory_ec, &__create_directory_p,
> &__create_directory_attributes);
> err.report(not_a_directory, "");
> }
> ```
>
> repro command: `clang++ -Wunsafe-buffer-usage crash.cpp`
Isn't `__attribute__((__format__(__printf__, 3, 4))) void report(errc, char
*);` a compilation error by default?
https://github.com/llvm/llvm-project/pull/173096
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits