- 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
Diff Detail
- Repository
- rC Clang
- Build Status
Buildable 13260 Build 13260: arc lint + arc unit
Event Timeline
| lib/Sema/SemaDecl.cpp | ||
|---|---|---|
| 12182–12184 | 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 | ||
|---|---|---|
| 12182–12184 | 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. | |
- Added a check for null in ActOnSkippedBody
| lib/Sema/SemaDecl.cpp | ||
|---|---|---|
| 12182–12184 | 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. | |
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.