[LLVMbugs] [Bug 23776] static_assert fails when applied to function parameter

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jun 7 12:25:29 PDT 2015


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |INVALID

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Sorry, Clang is correct here. The subexpression 'm' makes this expression
non-constant per [expr.const] (5.20)/2.9, because this means the static_assert
condition contains:

"an id-expression that refers to a variable or data member of reference type
unless the reference has a preceding initialization and either
— it is initialized with a constant expression or
— it is a non-static data member of an object whose lifetime began within the
evaluation of e;"

(Basically, the evaluation of the expression 'm' attempts to resolve which
object is denoted by the reference, which fails.)

-- 
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/20150607/6ae7b345/attachment.html>


More information about the llvm-bugs mailing list