[PATCH] D82446: [clang] Fix duplicate warning

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 24 08:04:22 PDT 2020


aaron.ballman added inline comments.


================
Comment at: clang/lib/Parse/ParseExprCXX.cpp:2273
   ParseSpecifierQualifierList(DS, AS_none, DeclSpecContext::DSC_type_specifier);
-  DS.Finish(Actions, Actions.getASTContext().getPrintingPolicy());
   return false;
----------------
kamleshbhalui wrote:
> aaron.ballman wrote:
> > This change is incorrect -- `Finish` is what ensures the `DeclSpec` is in a consistent state (even in the presence of errors), so removing it would be bad.
> you are right but ParseSpecifierQualifierList ->(calls) ParseDeclarationSpecifiers
> and it makes a call to Finish(https://github.com/llvm/llvm-project/blob/master/clang/lib/Parse/ParseDecl.cpp#L2962).
`ParseSpecifierQualifierList` then makes further modifications to the `DeclSpec`, such as setting it to have an error, clearing specific bits from it, etc. Do none of those further modifications require finalization?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82446/new/

https://reviews.llvm.org/D82446





More information about the cfe-commits mailing list