[LLVMbugs] [Bug 3577] clang does not detect some compile time constants.

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Feb 13 13:57:02 PST 2009


Chris Lattner <clattner at apple.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Chris Lattner <clattner at apple.com>  2009-02-13 15:57:01 ---
Unless this occurs in real world code, we should not care about fixing this
stuff.  Note that:

 int z = (&"Foobar"[1] - &"Foobar"[0]);

is not guaranteed to be evaluatable to a constant for many reasons.  For
example, with -fwritable-strings, the two strings will be distinct.

Yes we want to be compatible with GCC, but there is a line of pragmatics that
we need to draw also.  We're not going to reimplement all of GCC's "fold"
optimizer in clang.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list