In MismatchingNewDeleteDetector::analyzeInClassInitializer, if
Field's initializer expression is null, lookup the field in
implicit instantiation, and use found field's the initializer.
Details
Details
- Reviewers
rtrieu majnemer rsmith - Commits
- rG832552ac7e33: Merging r251335:
rG7ff183647115: MismatchingNewDeleteDetector uses incorrect field, and finds no initializer
rC251335: MismatchingNewDeleteDetector uses incorrect field, and finds no initializer
rL251335: MismatchingNewDeleteDetector uses incorrect field, and finds no initializer
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Sema/SemaExprCXX.cpp | ||
---|---|---|
2494 ↗ | (On Diff #26189) | You'll still crash if this check fails. You could assert this condition instead, but InitExpr could still be null even then, in principle (if we're somehow getting called while still parsing the definition of the class). The in-class initializer is not relevant if no constructor actually uses it. Instead of this change, you could just return EndOfTU ? NoMismatch : AnalyzeLater if InitExpr is null. |
Comment Actions
Ping! It seems like this patch was forgotten. This fixes PR24730, which is reported recently.