aaron.ballman added inline comments.
================ Comment at: clang/lib/Sema/SemaDecl.cpp:16686-16687 + if (RD->hasAttr<SYCLSpecialClassAttr>()) { + auto *Def = RD->getDefinition(); + if (Def && !Def->hasInitMethod()) + Diag(RD->getLocation(), ---------------- zahiraam wrote: > aaron.ballman wrote: > > I think we can assert there is a definition given that this is called from > > "ActOnTagFinishDefinition". > @aaron.ballman Not sure what you mean by "that this is called from". We are > inside the ActOnTagFinishDefinition function. Sorry for being unclear -- yes, we're inside `ActOnTagFinishDefinition()` and we just called `FinishClass()`, so I don't think we need to test `if (Def)`. Instead, I think we can do: ``` const TagDecl *Def = RD->getDefinition(); assert(Def && "Expected to have a completed definition"); if (!Def->hasInitMethod()) ``` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114483/new/ https://reviews.llvm.org/D114483 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits