HerrCai0907 marked an inline comment as done.
HerrCai0907 added inline comments.


================
Comment at: clang/lib/Parse/ParseDecl.cpp:7385
           if (!ConsumeAndStoreInitializer(*DefArgToks, CIK_DefaultArgument)) {
             DefArgToks.reset();
+            Diag(ArgStartLoc, diag::err_expected) << "initializer";
----------------
rsmith wrote:
> I think we should just remove this `reset` call. That way, the tokens we've 
> accumulated will get parsed when we come to later process the default 
> argument, and we can produce the proper error at that time, such as 
> diagnosing a missing `:`. That's what we do for default member initializers.
Only remove `reset` does not work. I think it doesn't need to issue diagnose 
here. We can add it as a unparsedDefaultArgument and issue it when parsing.


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