Rakete1111 added inline comments.
================ Comment at: lib/Sema/SemaDeclCXX.cpp:6174 + Record->hasAttr<TriviallyRelocatableAttr>() && + !isTemplateInstantiation(Record->getTemplateSpecializationKind())) { + if (Record->getDefinition() && !Record->isDependentContext() && ---------------- The call to `isTemplateInstantiation` is wrong. Consider: ``` template<class T> struct [[trivially_relocatable]] A { T t; }; struct X { X() = default; X(X &&) = delete; }; A<X> d; static_assert(!__is_trivially_relocatable(decltype(d))); // oops, fires ``` There is also no diagnostic saying that `A<X>` cannot be marked `[[trivially_relocatable]]`. ================ Comment at: lib/Sema/SemaDeclCXX.cpp:6176 + if (Record->getDefinition() && !Record->isDependentContext() && + !Record->isBeingDefined()) { + // Check that the destructor is non-deleted. ---------------- `Record` is never being defined at this point, even for templates. It also always has a definition AFAIK. Repository: rC Clang https://reviews.llvm.org/D50119 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits