https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119111
Bug ID: 119111
Summary: [[deprecated]] attribute NOT work IF be placed
between () and {}
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: terryinzaghi at 163 dot com
Target Milestone: ---
gcc14.2 -std=c++23
[[deprecated(R"(
use new0 instead
because...
)")]] void old0() noexcept {};
void old2 [[deprecated(R"(
use new0 instead
because...
)")]] () noexcept{};
void old4() noexcept [[deprecated(R"(
use new0 instead
because...
)")]] {};
void old5() noexcept [[deprecated("use new0 insteadb")]] {};
void old6() [[deprecated("use new0 insteadb")]] {};
void old7() [[deprecated]] {};
int main() {
old0();//work
old2();//work
old4(); //NOT work
old5(); //NOT work
old6(); //NOT work
old7(); //NOT work
}
-------
old5 old6 old7 may NOT be valid syntax,
BUT can be compiled succesfully.
------
https://godbolt.org/z/K5EP5zY8j