[Sema] Fix crash on __fp16 parameters in template instantiations
Fixes #61441. Currently, Clang stores `nullptr` in the parameter lists inside `FunctionProtoTypeLoc` if `__fp16` is used without pointer qualifiers. Any code path that calls `Declarator::setInvalidType()` before `GetFullTypeForDeclarator` will lead to the same problem downstream. The relevant code is: ```cpp if (D.isInvalidType()) return Context.getTrivialTypeSourceInfo(T); return GetTypeSourceInfoForDeclarator(state, T, TInfo); ``` `GetTypeSourceInfoForDeclarator` sets the parameter `Decl`, but we can't call it when `isInvalidType() == true` as this causes other assertion failures that seem harder to fix. Reviewed By: kadircet Differential Revision: https://reviews.llvm.org/D146426
Loading
Please sign in to comment