This is an archive of the discontinued LLVM Phabricator instance.

[AST][RecoveryAST] Preseve invalid return stmt, and suppress the diagnostics for missing return stmt in constexpr func.
ClosedPublic

Authored by hokein on Jun 22 2020, 12:19 AM.

Diff Detail

Event Timeline

hokein created this revision.Jun 22 2020, 12:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2020, 12:19 AM

This is a nice coverage improvement but diagnostic changes don't seem to particularly be improvements... not opposed to landing as-is but want to consider if we can mitigate these...

clang/test/SemaCXX/constant-expression-cxx11.cpp
1812

an idea (not sure if feasible) - do we want to suppress "not valid in constant expression" errors when the expressions contains errors?
If so, may want a (different) FIXME here

clang/test/SemaCXX/lambda-expressions.cpp
522 ↗(On Diff #272340)

this seems like a regression - what exactly is going on here?

in a perfect world I guess we'd e.g. leave the type undeduced from the first return, rather than deduce it as undeduced-auto (at least for the purposes of diagnostics).

clang/test/SemaCXX/typo-correction-crash.cpp
19–20

this is also a regression, though this code is pretty broken and is really just asserting no crash.

Any interest in chasing these diagnostic regressions (they seem like they might be tractable) or should we abandon this?

hokein updated this revision to Diff 307980.Nov 27 2020, 12:54 AM

rebase and update

sorry for the long delay, picking it up.

clang/test/SemaCXX/constant-expression-cxx11.cpp
1812

the extra diagnostics don't exit any more in the trunk (I think it is because we support the error-dependent expression in const evaluator).

clang/test/SemaCXX/lambda-expressions.cpp
522 ↗(On Diff #272340)

this is an exiting issue in clang, and our tests don't cover that. https://reviews.llvm.org/D92211 will fix that.

clang/test/SemaCXX/typo-correction-crash.cpp
19–20

this seems non-trivial to fix (we have a too strong invalidation for decltype on an error expression, the declarator is marked invalid), I'd defer the fix (since this is not a critical case, and the code is pretty broken).

sammccall accepted this revision.Nov 27 2020, 1:28 AM

LG once D92211 lands.

This revision is now accepted and ready to land.Nov 27 2020, 1:28 AM
This revision was landed with ongoing or failed builds.Nov 30 2020, 12:27 AM
This revision was automatically updated to reflect the committed changes.