Throwing exception uses incorrect copy constructor #38149
Labels
bugzilla
Issues migrated from bugzilla
c++
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
confirmed
Verified by a second party
platform:windows
Extended Description
Hello all,
The following code seems to have problems being executed.
It looks like when throwing an exception, Clang tries to use a copy constructor for the exception, however, instead of using the
const&
variant, it searches for a variant without the const.So instead of using the Copy constructor, it uses the variadic Ctor, which is not as expected.
test.cpp
run.bat
clang-cl.exe -fms-compatibility-version=19.11 /DBOOST_USE_WINDOWS_H -w -Wno-unused-command-line-argument /Zc:inline /nologo /c /GR /EHsc /fp:precise /FS /std:c++17 /diagnostics:caret /O2 /I. /MDd /Zc:forScope /bigobj /Zc:wchar_t test.cpp
error
The text was updated successfully, but these errors were encountered: