[Bug c++/115792] GCC accepts [] throw () {}

2024-07-05 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115792 Xi Ruoyao changed: What|Removed |Added Status|RESOLVED|REOPENED CC|

[Bug c++/115792] GCC accepts [] throw () {}

2024-07-05 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115792 --- Comment #9 from Jonathan Wakely --- throw() is not valid in C++23 at all (nor in C++20). GCC accepts it as an extension, but should probably warn with -pedantic. I don't think Clang is wrong here. Should we reopen this to add a pedwarn for

[Bug c++/115792] GCC accepts [] throw () {}

2024-07-05 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115792 --- Comment #8 from Andrew Pinski --- (In reply to 康桓瑋 from comment #7) > (In reply to Andrew Pinski from comment #6) > > So I looked into the change for clang: > > https://github.com/llvm/llvm-project/commit/ > > 0620e6f4b76a9725dbd82454d58c5a6

[Bug c++/115792] GCC accepts [] throw () {}

2024-07-05 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115792 --- Comment #7 from 康桓瑋 --- (In reply to Andrew Pinski from comment #6) > So I looked into the change for clang: > https://github.com/llvm/llvm-project/commit/ > 0620e6f4b76a9725dbd82454d58c5a68a7e47074 > > And they didn't add a testcase for th

[Bug c++/115792] GCC accepts [] throw () {}

2024-07-05 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115792 --- Comment #6 from Andrew Pinski --- So I looked into the change for clang: https://github.com/llvm/llvm-project/commit/0620e6f4b76a9725dbd82454d58c5a68a7e47074 And they didn't add a testcase for throw(). Only noexcept. GCC add a testcase for

[Bug c++/115792] GCC accepts [] throw () {}

2024-07-05 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115792 --- Comment #5 from Andrew Pinski --- Looks like clang misses exception specifiers as being optional before the parm. Most likely because only `throw()` is valid for C++17+.

[Bug c++/115792] GCC accepts [] throw () {}

2024-07-05 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115792 --- Comment #4 from Andrew Pinski --- (In reply to Andrew Pinski from comment #1) > Note it looks like clang does not implement `parameter declaration before > lambda declaration specifiers only optional with C++23` as clang rejects: s/clang/MS

[Bug c++/115792] GCC accepts [] throw () {}

2024-07-05 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115792 --- Comment #3 from Andrew Pinski --- "Exception specifications and noexcept" from the paper. So yes GCC is correct.

[Bug c++/115792] GCC accepts [] throw () {}

2024-07-05 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115792 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/115792] GCC accepts [] throw () {}

2024-07-05 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115792 --- Comment #1 from Andrew Pinski --- Note it looks like clang does not implement `parameter declaration before lambda declaration specifiers only optional with C++23` as clang rejects: ``` auto l = [] static {}; ``` Note all 3 accept: ``` auto