public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/2864: misleading error message about default arg initialization
@ 2002-04-25  7:39 nathan
  0 siblings, 0 replies; 2+ messages in thread
From: nathan @ 2002-04-25  7:39 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, wolfgang.bangerth

Synopsis: misleading error message about default arg initialization

State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Thu Apr 25 07:39:05 2002
State-Changed-Why:
    yes, but I suspect difficult until two phase name binding
    happens.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=2864


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c++/2864: misleading error message about default arg initialization
@ 2001-05-18  2:06 wolfgang.bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: wolfgang.bangerth @ 2001-05-18  2:06 UTC (permalink / raw)
  To: gcc-gnats

>Number:         2864
>Category:       c++
>Synopsis:       misleading error message about default arg initialization
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri May 18 02:06:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Bangerth
>Release:        unknown-1.0
>Organization:
>Environment:
gcc 2.95, gcc cvs of May 05
>Description:
Initializing a default arg by the value of another argument
to the same function is not allowed and detected at the
spot of the attempt by gcc for non-template classes. However,
for template classes, the error message pops up at the point
of instantiation which confuses the user as the name of the
object to which the compiler objects is not used in that scope.
It would be more appropriate to either detect the error when
parsing the template class, or at least attribute the error
to the place of the erroneous declaration.
Regards
  Wolfgang
  Wolfgang
>How-To-Repeat:
-----/gcc-bugs> cat a.cc
template <int dim> struct X {
    X (int i=0, int j=i);
};

X<1> x;

-----/gcc-bugs> ~/Config/gcc-ss-sun/bin/gcc -W -Wall -ansi -c a.cc -o /dev/null
a.cc: In function `void __static_initialization_and_destruction_0(int, int)':
a.cc:6: `i' undeclared (first use this function)
a.cc:6: (Each undeclared identifier is reported only once
a.cc:6: for each function it appears in.)


-----/gcc-bugs> ~/Config/gcc-ss-sun/bin/gcc -v                                 
Reading specs from /home/atlas2/wolf/Config/gcc-ss-sun/bin/../lib/gcc-lib/sparc-sun-solaris2.7/3.0/specs
Configured with: ../gcc/configure --prefix=/home/people/wolf/Config/gcc-ss-sun --with-gnu-as --with-as=/usr/local/bin/as --with-gnu-ld --with-ld=/usr/local/bin/ld
Thread model: posix
gcc version 3.0 20010514 (prerelease)
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-04-25 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-25  7:39 c++/2864: misleading error message about default arg initialization nathan
  -- strict thread matches above, loose matches on Subject: below --
2001-05-18  2:06 wolfgang.bangerth

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).