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

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to