[PATCH] D105478: [clang] Make CXXRecrdDecl invalid if it contains any undeduced fields.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 13 05:16:43 PDT 2021


hokein added a comment.

In D105478#2867120 <https://reviews.llvm.org/D105478#2867120>, @adamcz wrote:

> OK, I think we've got it now :-)
>
> I kept the original crash test in the change, but I'm not sure if it's appropriate anymore. Let me know if you think I should remove it.

Thanks, that sounds good to me, the original crash test is valuable, worth to keep it.



================
Comment at: clang/lib/Parse/ParseDeclCXX.cpp:2987
+        if (ThisDecl)
+          ThisDecl->setInvalidDecl();
         SkipUntil(tok::comma, StopAtSemi | StopBeforeMatch);
----------------
it seems to me calling `Sema::ActOnInitializerError(ThisDecl)` is a better fit, rather than invalidating the decl once the initializer is failed to parse, for example `static const int Member = ;` we want to keep the decl valid.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105478



More information about the cfe-commits mailing list