rjmccall added a comment.

Unfortunately, this initialization case does allow a situation where


================
Comment at: clang/lib/AST/ItaniumMangle.cpp:5561
+  // field represents an anonymous record type.
+  const CXXRecordDecl *RD = FD->getType()->getAsCXXRecordDecl();
+
----------------
Alas, bit-fields are also allowed to be anonymous.


================
Comment at: clang/lib/AST/ItaniumMangle.cpp:5576
+      "program to refer to the anonymous union, and there is therefore no need 
"
+      "to mangle its name. '");
+}
----------------
Unfortunately, I think class value mangling has a counter-example to this: you 
can have an anonymous struct or union which doesn't declare any named members 
but will of course nonetheless show up in the list of members in the enclosing 
class.  Code can even give it a non-zero initializer using list-initialization; 
that value can never be read, but it's there, and presumably it's part of 
uniquely determining a different template argument value and therefore needs to 
be mangled.

I don't know what we should do about this in the ABI, but we shouldn't crash in 
the compiler.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122820/new/

https://reviews.llvm.org/D122820

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to