Issue 110321
Summary [clang++-18] Unexpected `deprecated-declarations` warning, when this warning is explicitly suppressed
Labels clang
Assignees
Reporter ralfkonrad
    `clang-18` shows an unexpected `deprecated-declarations` warning when a deprecated constructor is used in `std::make_shared<T>(args from deprecated constructor...)` while the warning is turned of using `_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")`.

On the other hand using `std::shared_ptr<T>(new T(args from deprecated constructor...))` does not emit any warning as expected when it off.

Neiter `clang-16` and `clang-17` nor `gcc` on `ubuntu-24.04` and `msvc` emit a warning.

The same behaviour can be seen with `boost::shared_ptr` instead of `std::shahred_ptr`.

To reproduce this issue, see https://github.com/ralfkonrad/clang_deprecation_warning and its [workflow results](https://github.com/ralfkonrad/clang_deprecation_warning/actions).

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to