[PATCH] Follow-up to D6217

Richard Smith richard at metafoo.co.uk
Thu Nov 13 19:32:40 PST 2014


LGTM

================
Comment at: lib/Sema/SemaChecking.cpp:3436-3444
@@ +3435,11 @@
+
+    if (TrueTy == FalseTy)
+      return { TrueTy, TrueName };
+    else if (TrueTy.isNull())
+      return { FalseTy, FalseName };
+    else if (FalseTy.isNull())
+      return { TrueTy, TrueName };
+  }
+
+  return { QualType(), StringRef() };
+}
----------------
I would be surprised if all our supported compilers cope with this syntax. Happily surprised, but surprised nonetheless.

================
Comment at: test/CodeGen/complex.c:106-107
@@ +105,4 @@
+  char c[(int)(sizeof(typeof((0 ? 2.0f : (_Complex double) 2.0f))) - sizeof(_Complex double))];
+  // Check for proper codegen
+  (0 ? 2.0f : (_Complex double) 2.0f);
+}
----------------
Please also add the same test but with the operands reversed.

http://reviews.llvm.org/D6256






More information about the cfe-commits mailing list