https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104661
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Catching exception by const |[C++17+] Catching exception |value when exception-object |by const value when |has lvalue-reference |exception-object has |constructor |lvalue-reference | |constructor --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note clang accepts the code only with -std=c++17 and -std=c++20 as you didn't mention in the bug report as you passing. C++17 changed some rules and all.