[clang] [HLSL] Implement HLSL intialization list support (PR #123141)
Justin Bogner via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 14 12:58:24 PST 2025
================
@@ -1462,6 +1462,14 @@ void CXXRecordDecl::addedMember(Decl *D) {
if (Using->getDeclName().getCXXOverloadedOperator() == OO_Equal)
data().HasInheritedAssignment = true;
}
+
+ // HLSL: All user-defined data types are aggregates and use aggregate
+ // initialization. This _needs_ to change in the future. There are two
+ // relevant HLSL feature proposals that will depend on this changing:
+ // * 0005-strict-initializer-lists.md
+ // * https://github.com/microsoft/hlsl-specs/pull/325
+ if (getLangOpts().HLSL)
+ data().Aggregate = data().UserDeclaredSpecialMembers == 0;
----------------
bogner wrote:
Does this comment match what this is doing? If I'm reading this correctly we're using the fact that there are no user declared constructors/destructors/assignment operators to decide that this is an aggregate - I guess that's because users aren't allowed to write those in HLSL so we can use it as a proxy?
https://github.com/llvm/llvm-project/pull/123141
More information about the cfe-commits
mailing list