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

Richard Smith <[email protected]> changed:

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

--- Comment #3 from Richard Smith <[email protected]> ---
This behavior is correct, and required by the standard. See [expr.const]/14:

"An expression or conversion is manifestly constant-evaluated if it is [...]
the initializer of a variable that [...] has constant initialization"

'globalVariable' has constant initialization, so is_constant_evaluated()
returns true during its initialization.

MSVC has a very long-standing bug where it fails to properly implement constant
initialization for global variables; that's probably why you're seeing a
behavior difference between the two compilers here.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to