http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56251

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #7 from Daniel Krügler <daniel.kruegler at googlemail dot com> 
2013-02-10 16:00:42 UTC ---
(In reply to comment #6)
I agree with Paolo and Andrew when considered as a potentially C++03 code, but
I would like to add that the example code is indeed valid in C++11, because
ellipsis functions such as printf have an lvalue-to-rvalue semantics for the
function arguments and the ODR rule has been revised to say

"A variable x whose name appears as a potentially-evaluated expression ex is
odr-used unless x is an object that satisfies the requirements for appearing in
a constant expression (5.19) and ex is an element of the set of potential
results of an expression e, where either the lvalue-to-rvalue conversion (4.1)
is applied
to e, or e is a discarded-value expression (Clause 5)."

Of-course this allowance doesn't require that an implementation needs to add
"DW_AT_const_value" for such static const members: The rule only reflects
existing practice that this use-case is no ODR-usage of CC::value or of
TCC<int, int>::tvalue, respectively.

Reply via email to