[PATCH] Mangling of anonymous unions

Richard Smith richard at metafoo.co.uk
Wed Nov 26 19:03:16 PST 2014


================
Comment at: lib/AST/ItaniumCXXABI.cpp:65-67
@@ +64,5 @@
+    if (!Identifier) {
+      if (const RecordType *RT = VD->getType()->getAs<RecordType>()) {
+        const RecordDecl *RD = RT->getDecl();
+        if (RD->isUnion()) {
+          if (const FieldDecl *FD = RD->findFirstNamedDataMember()) {
----------------
How is it possible to get here with a `VarDecl` with no identifier, but where it's not an anonymous union? Please either add a comment explaining or change this to an `assert`/`castAs`.

http://reviews.llvm.org/D6295






More information about the cfe-commits mailing list