[llvm-bugs] [Bug 42295] _Static_assert(.1 == .1, ""); won't compile

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 17 10:55:16 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42295

Richard Smith <richard-llvm at metafoo.co.uk> changed:

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

--- Comment #2 from Richard Smith <richard-llvm at metafoo.co.uk> ---
C11 6.7.10/3: "The constant expression shall be an integer constant
expression."

C11 6.6/6: "117)An integer constant expression shall have integer type and
shall only have operands that are integer constants, enumeration constants,
character constants, sizeof expressions whose results are integer constants,
_Alignof expressions, and floating constants that are the immediate operands of
casts. Cast operators in an integer constant expression shall only convert
arithmetic types to integer types, except as part of an operand to the sizeof
or _Alignof operator."

So Clang is correct to reject this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190617/a18bcd5e/attachment.html>


More information about the llvm-bugs mailing list