llvm-project
c0005dfe - [Clang] Fix crash instantiating functions defaulted outside class templates (#240376)

Commit
1 day ago
[Clang] Fix crash instantiating functions defaulted outside class templates (#240376) A function that is defaulted outside its class template is not defaulted when its declaration is instantiated, so the instantiation of its definition reuses the info recorded at its definition (#229560). However, `SetDeclDefaulted` returned for such a pattern before recording the floating-point features in effect there, so the pattern usually had no info, and the transfer set the info bit with a null pointer. If non-default floating-point features were in effect at the point of instantiation, `SetDeclDefaulted` then tried to store them and asserted that the function already had the info. Even without the crash, the instantiation took the floating-point features in effect at its point of instantiation rather than at its definition, which also crashed codegen when those were strict but the function was not. Fixes #240351
Author
Parents
Loading