public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12397] New: 3.4 regression: two-stage name lookup (?) argument shadowed by global type
@ 2003-09-25  9:58 jan at etpmod dot phys dot tue dot nl
  2003-09-25 15:52 ` [Bug c++/12397] [3.4 regression] two-stage name lookup " bangerth at dealii dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jan at etpmod dot phys dot tue dot nl @ 2003-09-25  9:58 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: 3.4 regression: two-stage name lookup (?) argument
                    shadowed by global type
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jan at etpmod dot phys dot tue dot nl
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

struct foo { }; 
 
template <typename T> struct bar 
{ 
    bar(){} 
    int i; 
    bar (const bar<T>& foo) : i (foo.i) {} 
}; 
 
int main() 
{ 
        bar<int> b1; 
        bar<int> b2(b1); 
} 
 
With gcc-head (today) this gives: 
 
/usr/local/gcc-head/bin/g++ t.cpp 
t.cpp: In copy constructor `bar<T>::bar(const bar<T>&)': 
t.cpp:7: error: 'struct foo' has no member named 'i' 
 
Observations: 
 
It seems that in line 7 the compiler tries to access the member i 
of the global struct foo, since: 
 
1) removing struct foo solves the problem 
2) after adding a member 'int i' to struct foo the code compiles (!) 
   a member of a non-existant object seems to be accessed then. 
 
The equivalent code without templates compiles fine. 
 
Previous gcc-releases compile this code without problems. 
 
I re-read 14.6 just to be sure but assume (hope!) that this is a compiler bug. It maybe remotely 
related to the weirdness of PR12370. 
 
/usr/local/gcc-head/bin/g++ -v 
Reading specs from /usr/local/gcc-head/lib/gcc/i686-pc-linux-gnu/3.4/specs 
Configured with: ../gcc-head/configure --prefix=/usr/local/gcc-head --enable-lan 
guages=c,c++ : (reconfigured)  : (reconfigured)  : (reconfigured) 
Thread model: posix 
gcc version 3.4 20030925 (experimental)


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

* [Bug c++/12397] [3.4 regression] two-stage name lookup argument shadowed by global type
  2003-09-25  9:58 [Bug c++/12397] New: 3.4 regression: two-stage name lookup (?) argument shadowed by global type jan at etpmod dot phys dot tue dot nl
@ 2003-09-25 15:52 ` bangerth at dealii dot org
  2003-09-27  5:17 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2003-09-25 15:52 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-09-25 14:37:14
               date|                            |
            Summary|3.4 regression: two-stage   |[3.4 regression] two-stage
                   |name lookup (?) argument    |name lookup argument
                   |shadowed by global type     |shadowed by global type
   Target Milestone|---                         |3.4


------- Additional Comments From bangerth at dealii dot org  2003-09-25 14:37 -------
Confirmed. A regression on mainline.

W.


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

* [Bug c++/12397] [3.4 regression] two-stage name lookup argument shadowed by global type
  2003-09-25  9:58 [Bug c++/12397] New: 3.4 regression: two-stage name lookup (?) argument shadowed by global type jan at etpmod dot phys dot tue dot nl
  2003-09-25 15:52 ` [Bug c++/12397] [3.4 regression] two-stage name lookup " bangerth at dealii dot org
@ 2003-09-27  5:17 ` pinskia at gcc dot gnu dot org
  2003-10-20 19:50 ` bangerth at dealii dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-09-27  5:17 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
           Keywords|                            |rejects-valid


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-09-27 04:45 -------
>From Phil's regression hunter:
: Search converges between 2003-07-15-trunk (#344) and 2003-07-16-trunk (#345).
Also the error message changed from 
input.cc: In copy constructor `bar::bar(const bar&)':
input.cc:7: error: insufficient contextual information to determine type
To:
input.cc: In copy constructor `bar::bar(const bar&)':
input.cc:7: error: 'struct foo' has no member named 'i'
Between 2003-08-19 and 2003-08-20.


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

* [Bug c++/12397] [3.4 regression] two-stage name lookup argument shadowed by global type
  2003-09-25  9:58 [Bug c++/12397] New: 3.4 regression: two-stage name lookup (?) argument shadowed by global type jan at etpmod dot phys dot tue dot nl
  2003-09-25 15:52 ` [Bug c++/12397] [3.4 regression] two-stage name lookup " bangerth at dealii dot org
  2003-09-27  5:17 ` pinskia at gcc dot gnu dot org
@ 2003-10-20 19:50 ` bangerth at dealii dot org
  2003-12-22 20:37 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2003-10-20 19:50 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From bangerth at dealii dot org  2003-10-20 19:50 -------
This looks related to PR 12694.


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

* [Bug c++/12397] [3.4 regression] two-stage name lookup argument shadowed by global type
  2003-09-25  9:58 [Bug c++/12397] New: 3.4 regression: two-stage name lookup (?) argument shadowed by global type jan at etpmod dot phys dot tue dot nl
                   ` (2 preceding siblings ...)
  2003-10-20 19:50 ` bangerth at dealii dot org
@ 2003-12-22 20:37 ` mmitchel at gcc dot gnu dot org
  2003-12-22 20:55 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2003-12-22 20:37 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/12397] [3.4 regression] two-stage name lookup argument shadowed by global type
  2003-09-25  9:58 [Bug c++/12397] New: 3.4 regression: two-stage name lookup (?) argument shadowed by global type jan at etpmod dot phys dot tue dot nl
                   ` (3 preceding siblings ...)
  2003-12-22 20:37 ` mmitchel at gcc dot gnu dot org
@ 2003-12-22 20:55 ` cvs-commit at gcc dot gnu dot org
  2003-12-22 21:01 ` mmitchel at gcc dot gnu dot org
  2003-12-22 21:01 ` mmitchel at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-12-22 20:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-12-22 20:52 -------
Subject: Bug 12397

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2003-12-22 20:52:55

Modified files:
	gcc/cp         : ChangeLog typeck.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: lookup3.C 

Log message:
	PR c++/12397
	* typeck.c (finish_class_member_access_expr): Don't tree
	IDENTIFIER_NODEs as non-dependent expressions.
	
	PR c++/12397
	* g++.dg/template/lookup3.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3830&r2=1.3831
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.516&r2=1.517
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3300&r2=1.3301
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/lookup3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c++/12397] [3.4 regression] two-stage name lookup argument shadowed by global type
  2003-09-25  9:58 [Bug c++/12397] New: 3.4 regression: two-stage name lookup (?) argument shadowed by global type jan at etpmod dot phys dot tue dot nl
                   ` (4 preceding siblings ...)
  2003-12-22 20:55 ` cvs-commit at gcc dot gnu dot org
@ 2003-12-22 21:01 ` mmitchel at gcc dot gnu dot org
  2003-12-22 21:01 ` mmitchel at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2003-12-22 21:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2003-12-22 20:54 -------
Fixed in GCC 3.4.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug c++/12397] [3.4 regression] two-stage name lookup argument shadowed by global type
  2003-09-25  9:58 [Bug c++/12397] New: 3.4 regression: two-stage name lookup (?) argument shadowed by global type jan at etpmod dot phys dot tue dot nl
                   ` (5 preceding siblings ...)
  2003-12-22 21:01 ` mmitchel at gcc dot gnu dot org
@ 2003-12-22 21:01 ` mmitchel at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2003-12-22 21:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2003-12-22 20:55 -------
*** Bug 12694 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |belz at kolumbus dot fi


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


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

end of thread, other threads:[~2003-12-22 20:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-25  9:58 [Bug c++/12397] New: 3.4 regression: two-stage name lookup (?) argument shadowed by global type jan at etpmod dot phys dot tue dot nl
2003-09-25 15:52 ` [Bug c++/12397] [3.4 regression] two-stage name lookup " bangerth at dealii dot org
2003-09-27  5:17 ` pinskia at gcc dot gnu dot org
2003-10-20 19:50 ` bangerth at dealii dot org
2003-12-22 20:37 ` mmitchel at gcc dot gnu dot org
2003-12-22 20:55 ` cvs-commit at gcc dot gnu dot org
2003-12-22 21:01 ` mmitchel at gcc dot gnu dot org
2003-12-22 21:01 ` mmitchel at gcc dot gnu dot org

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