[PATCH] D148372: [clang] add diagnose when member function contains invalid default argument
Congcong Cai via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 14 22:36:26 PDT 2023
HerrCai0907 added a comment.
> While this will fix the crash I am a little concerned that I don't a diagnostic for each place we call ActOnParamDefaultArgumentError(...), there is only once place where we diagnose this the rest don't. So I wonder if this was purposeful or not.
No, before `ActOnParamDefaultArgumentError` we either call `Diag` or use `Actions.CorrectDelayedTyposInExpr` to diagnoise except here. And the coverage report shows that this is not covered by any test code[1]. So I guess it miss something.
> We are not actually diagnosing the main problem which is a malformed conditional expression.
I also want to diagnose main problem. Should I emit diagnose in `ConsumeAndStoreInitializer` directly (control by a bool argument e.g. `IsDiag`)?
[1] https://lab.llvm.org/coverage/coverage-reports/coverage/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/Parse/ParseDecl.cpp.html#L7388
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148372/new/
https://reviews.llvm.org/D148372
More information about the cfe-commits
mailing list