https://llvm.org/bugs/show_bug.cgi?id=31624
Richard Smith <richard-l...@metafoo.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |richard-l...@metafoo.co.uk Resolution|--- |INVALID --- Comment #1 from Richard Smith <richard-l...@metafoo.co.uk> --- Nope, GCC and CL are wrong. [expr.const]/2.10: "[An expression is not a constant expression if it would evaluate] 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 — its lifetime began within the evaluation of e;" Because the expression uses the name 'f' and that name cannot be evaluated, the expression is not a constant expression. It doesn't matter that the callee is a static function; evaluation of the LHS must succeed. Consider: (something with arbitrary non-constant side effects, f).hasBar() This is obviously not constant. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs