simon_tatham added a comment.

The clang code change looks reasonable to me, but I'm not the most expert in 
that area.

The intended result certainly seems sensible, because the C90-compatible 
version of that code //without// a constant literal is happy to do double→float 
conversion at compile time without complaining about side effects:

  static const float separate_array[1] = { 0.1, };
  struct { const float *floats; } without_compound_literal = { separate_array };

and so it makes sense that the version with a compound literal should be 
treated no differently.

Nit in the commit message:

> which should be in effect yet

Surely "which //shouldn't// be in effect yet"?



================
Comment at: clang/test/CodeGen/const-init.c:1
-// RUN: %clang_cc1 -no-opaque-pointers -triple i386-pc-linux-gnu 
-ffreestanding -Wno-pointer-to-int-cast -Wno-int-conversion -emit-llvm -o - %s 
| FileCheck %s
+// RUN: %clang_cc1 -no-opaque-pointers -triple i386-pc-linux-gnu 
-ffreestanding -Wno-pointer-to-int-cast -Wno-int-conversion 
-ffp-exception-behavior=strict -emit-llvm -o - %s | FileCheck %s
 
----------------
I think some kind of a comment would be useful saying what this option is doing 
there -- at least, which one of the tests further down the file it's supposed 
to apply to. Otherwise I could easily imagine someone throwing it out again, 
and since the test would pass anyway, not noticing that it's no longer testing 
what it's meant to test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131555

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

Reply via email to