- Fixed an assert in Sema::InstantiateFunctionDefinition and added support for instantiating a function template with skipped body.
- Properly call setHasSkippedBody for FunctionTemplateDecl passed to Sema::ActOnSkippedFunctionBody.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Sema/SemaDecl.cpp | ||
---|---|---|
12184 ↗ | (On Diff #126947) | In the case of Decl == nullptr this code would crash. Probably it makes sense to check for this condition at the beginning of the function and use dyn_cast instead of dyn_cast_or_null in the next check. |
lib/Sema/SemaDecl.cpp | ||
---|---|---|
12184 ↗ | (On Diff #126947) | Do we have callsites that pass null to this function? I don't see a meaningful semantics for this function if we pass null here. |
Comment Actions
- Added a check for null in ActOnSkippedBody
lib/Sema/SemaDecl.cpp | ||
---|---|---|
12184 ↗ | (On Diff #126947) | After looking at the callsites, they actually suggest that nulls can be passed. Tried adding an assert and it didn't fire when running check-all, though. But it's better to be on the safe side. Added a check for null, updated the patch accordingly. |