This is an archive of the discontinued LLVM Phabricator instance.

Fix crash in Sema when wrongly assuming VarDecl init is not value dependent.
Needs ReviewPublic

Authored by teemperor on Sep 13 2017, 3:03 AM.
This revision needs review, but all reviewers have resigned.

Details

Reviewers
v.g.vassilev
Summary

The attached test case crashes Sema as we call IsVariableAConstantExpression which has as a precondition
that we don't call it on a VarDecl with a value dependent init expression.

Diff Detail

Event Timeline

teemperor created this revision.Sep 13 2017, 3:03 AM
teemperor added a subscriber: cfe-commits.

Could you double-check if we can add this to an existing test? Would test/SemaCXX/pr25181-crash-on-invalid.cpp fit and potentially rename it.

test/SemaCXX/cxx11-odr-use-crash-on-invalid.cpp
8

Looks like this line has spacing problems.

@teemperor, should we land this?

v.g.vassilev resigned from this revision.Jun 25 2022, 1:15 PM

According to godbolt this example does not crash anymore.

Herald added a project: Restricted Project. · View Herald TranscriptJun 25 2022, 1:15 PM