hokein added inline comments.
================ Comment at: clang/test/Sema/invalid-member.cpp:29 +}; +static_assert(sizeof(T) == 1, "No valid members"); ---------------- The current fix (by invalidating the member decl) is probably suboptimal. The crash is caused by the fact that we escape the dependent-type guard in HandleSizeOf -- the `recordType` T is not type-dependent, because the implementation `TagDecl::isDependentType` just checks `isDependentContext()`. This is incorrect after recovery-expr is introduced -- in this example, `ABC<N> abc` is type-dependent because the template argument DeclRefExpr is value-dependent, so the recordType T should be type-dependent. I think right fix is to make the recordType `T` type-dependent, but there are a few tricky things in clang making it harder: - The TagType is cached and uniqued, and the dependence-bits are set in the constructor; - The TagType can be created before we see the RecordDecl body; To set the type-dependent, we need to see class body, by that time, the TagType is created, and cached, I'm not sure it is reasonable to rewrite the dependence-bits when we complete a class definition. Any suggestions? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86048/new/ https://reviews.llvm.org/D86048 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits