public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56251] no DW_AT_const_value for static const member of a template class Date: Sun, 10 Feb 2013 16:00:00 -0000 [thread overview] Message-ID: <bug-56251-4-zpPpi9LDXX@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-56251-4@http.gcc.gnu.org/bugzilla/> 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.
prev parent reply other threads:[~2013-02-10 16:00 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-02-08 4:06 [Bug c++/56251] New: " chihin.ko at oracle dot com 2013-02-08 4:09 ` [Bug c++/56251] " pinskia at gcc dot gnu.org 2013-02-08 21:25 ` chihin.ko at oracle dot com 2013-02-08 21:29 ` pinskia at gcc dot gnu.org 2013-02-08 22:02 ` chihin.ko at oracle dot com 2013-02-08 22:10 ` pinskia at gcc dot gnu.org 2013-02-08 22:51 ` paolo.carlini at oracle dot com 2013-02-10 16:00 ` daniel.kruegler at googlemail dot com [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-56251-4-zpPpi9LDXX@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).