https://llvm.org/bugs/show_bug.cgi?id=28711
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> --- The expression "a.size()", used as a non-type template argument, is not a constant expression, as Clang reports. See [expr.const] (5.20)/2.10: "A conditional-expression e is [not a constant expression if evaluating it] would evaluate [...]: 2.10) an id-expression that refers to a variable or data member of reference type unless the reference has a preceding initialization and either 2.10.1) it is initialized with a constant expression or 2.10.2) its lifetime began within the evaluation of e" The id-expression "a" refers to a variable of reference type that is not initialized (it's a function parameter) and whose lifetime began outside the evaluation of e ("a.size()"). We can't determine which object is denoted by "a", so the expression is non-constant (even though "size()" would not have looked at that object). -- 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