This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/33861] Debugging info for C++ template parameters is incorrect
- From: "nathan at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Oct 2007 14:32:50 -0000
- Subject: [Bug debug/33861] Debugging info for C++ template parameters is incorrect
- References: <bug-33861-3264@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from nathan at gcc dot gnu dot org 2007-10-22 14:32 -------
the testcase is valid. [14.3.2]/2 essentially gives it as an example. A
literal '&' is optional in this case (para 1).
para 5 tells us that array to pointer decay happens here, and GCC internally
represents that as CAST_EXPR (<type>, ADDR_EXPR (<array_obj>)). It could have
used ADDR_EXPR (ARRAY_REF (<array_obj>, 0)), but it doesn't. That alternative
is equally invalid as a non-type template argument.
explicitly writing '(char *)&name' in the source is ill-formed though.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33861