nickdesaulniers added inline comments.
================
Comment at: clang/lib/Sema/SemaDecl.cpp:18891
+ // incomplete definition.
+ if (const auto *RD = dyn_cast<RecordDecl>(D))
+ return !RD->isCompleteDefinition();
----------------
nickdesaulniers wrote:
> void wrote:
> > nickdesaulniers wrote:
> > > what about `EnumDecl`s? I suspect the shared common base `TagDecl` might
> > > be better to use?
> > >
> > > If it is, can you add a test? I'm guessing
> > >
> > > ```
> > > struct foo {
> > > enum havent_seen_yet;
> > > enum havent_seen_yet2;
> > > }
> > > ```
> > > would be the test case.
> > Would testing for a `TagDecl` be better here?
> I think so; common shared base and same logic for both cases here. Unless
> there's something other than RecordDecl and EnumDecl where this shouldn't
> apply.
> Unless there's something other than RecordDecl and EnumDecl where this
> shouldn't apply.
The `TagDecl` constructor is only called from the `RecordDecl` and `EnumDecl`
constructors. So I think it's simpler to just check `TagDecl` base type rather
than each of the two derived types.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143300/new/
https://reviews.llvm.org/D143300
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits