public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/20637] New: [3.3/3.4/4.0/4.1 regression] Confusing message with different using declarations
@ 2005-03-25 16:27 bangerth at dealii dot org
  2005-03-25 17:13 ` [Bug c++/20637] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2005-03-25 16:27 UTC (permalink / raw)
  To: gcc-bugs

This was hard to find. Consider this snippet: 
------------------ 
struct B { 
    void f(); 
}; 
 
struct D : B { 
    using B::f; 
    B::f; 
}; 
------------------ 
Note that D contains old- and new-style using declarations. In my case, they 
were several hundred lines apart in D, so it wasn't quite so obvious. What 
I get is this: 
 
g/x> /home/bangerth/bin/gcc-4*/bin/c++ -c a.cc 
a.cc:2: error: ?void B::f()? and ?void B::f()? cannot be overloaded 
 
Note that it doesn't show where the attempt to overload happens, it only shows 
the original place. That's bad diagnostics. 
 
gcc2.95 didn't say anything about the code, so I rate this as a regression. 
 
W.

-- 
           Summary: [3.3/3.4/4.0/4.1 regression] Confusing message with
                    different using declarations
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/20637] [3.3/3.4/4.0/4.1 regression] Confusing message with different using declarations
  2005-03-25 16:27 [Bug c++/20637] New: [3.3/3.4/4.0/4.1 regression] Confusing message with different using declarations bangerth at dealii dot org
@ 2005-03-25 17:13 ` pinskia at gcc dot gnu dot org
  2005-03-25 20:12 ` bangerth at dealii dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-25 17:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-03-25 17:13 -------
Comeau gives the following error:
"ComeauTest.c", line 7: error: duplicate using-declaration of "B::f" ignored
      B::f; 

Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-03-25 17:13:29
               date|                            |
   Target Milestone|---                         |4.0.1


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


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

* [Bug c++/20637] [3.3/3.4/4.0/4.1 regression] Confusing message with different using declarations
  2005-03-25 16:27 [Bug c++/20637] New: [3.3/3.4/4.0/4.1 regression] Confusing message with different using declarations bangerth at dealii dot org
  2005-03-25 17:13 ` [Bug c++/20637] " pinskia at gcc dot gnu dot org
@ 2005-03-25 20:12 ` bangerth at dealii dot org
  2005-03-26  4:28 ` gdr at integrable-solutions dot net
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2005-03-25 20:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2005-03-25 20:12 -------
I should add that it doesn't matter whether you use old- or new-style 
using declarations: 
  B::f; 
  B::f; 
and 
  using B::f; 
  using B::f; 
yield the same results. 
 
W. 

-- 


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


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

* [Bug c++/20637] [3.3/3.4/4.0/4.1 regression] Confusing message with different using declarations
  2005-03-25 16:27 [Bug c++/20637] New: [3.3/3.4/4.0/4.1 regression] Confusing message with different using declarations bangerth at dealii dot org
  2005-03-25 17:13 ` [Bug c++/20637] " pinskia at gcc dot gnu dot org
  2005-03-25 20:12 ` bangerth at dealii dot org
@ 2005-03-26  4:28 ` gdr at integrable-solutions dot net
  2005-06-06 13:22 ` [Bug c++/20637] [3.4/4.0/4.1 " nathan at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-03-26  4:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2005-03-26 04:28 -------
Subject: Re:  New: [3.3/3.4/4.0/4.1 regression] Confusing message with different using declarations

"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| This was hard to find. Consider this snippet: 
| ------------------ 
| struct B { 
|     void f(); 
| }; 
|  
| struct D : B { 
|     using B::f; 
|     B::f; 
| }; 
| ------------------ 
| Note that D contains old- and new-style using declarations. In my case, they 
| were several hundred lines apart in D, so it wasn't quite so obvious. What 
| I get is this: 
|  
| g/x> /home/bangerth/bin/gcc-4*/bin/c++ -c a.cc 
| a.cc:2: error: ?void B::f()? and ?void B::f()? cannot be overloaded 
|  
| Note that it doesn't show where the attempt to overload happens, it only shows 
| the original place. That's bad diagnostics. 

Agreed.  But, I don't think that will be fixed in 3.3.x

-- Gaby


-- 


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


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

* [Bug c++/20637] [3.4/4.0/4.1 regression] Confusing message with different using declarations
  2005-03-25 16:27 [Bug c++/20637] New: [3.3/3.4/4.0/4.1 regression] Confusing message with different using declarations bangerth at dealii dot org
                   ` (2 preceding siblings ...)
  2005-03-26  4:28 ` gdr at integrable-solutions dot net
@ 2005-06-06 13:22 ` nathan at gcc dot gnu dot org
  2005-06-06 14:18 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: nathan at gcc dot gnu dot org @ 2005-06-06 13:22 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |nathan at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2005-03-25 17:13:29         |2005-06-06 13:22:21
               date|                            |


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


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

* [Bug c++/20637] [3.4/4.0/4.1 regression] Confusing message with different using declarations
  2005-03-25 16:27 [Bug c++/20637] New: [3.3/3.4/4.0/4.1 regression] Confusing message with different using declarations bangerth at dealii dot org
                   ` (3 preceding siblings ...)
  2005-06-06 13:22 ` [Bug c++/20637] [3.4/4.0/4.1 " nathan at gcc dot gnu dot org
@ 2005-06-06 14:18 ` cvs-commit at gcc dot gnu dot org
  2005-06-14  9:01 ` [Bug c++/20637] [3.4/4.0 " nathan at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-06-06 14:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-06-06 14:18 -------
Subject: Bug 20637

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	nathan@gcc.gnu.org	2005-06-06 14:18:22

Modified files:
	gcc/cp         : ChangeLog class.c cp-tree.h decl2.c method.c 
	                 semantics.c 
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/g++.dg/overload: error1.C 
	gcc/testsuite/g++.old-deja/g++.benjamin: warn02.C 
	gcc/testsuite/g++.old-deja/g++.brendan: arm2.C 
	gcc/testsuite/g++.old-deja/g++.other: redecl2.C redecl4.C 
	gcc/testsuite/g++.old-deja/g++.pt: memtemp78.C 
Added files:
	gcc/testsuite/g++.dg/inherit: using4.C 

Log message:
	cp:
	PR c++/20637
	* cp-tree.h (add_method): Add using_decl parameter.
	* class.c (add_method): Add using_decl parameter.  Adjust error
	messages.
	(handle_using_decl): Pass the using decl to add_method.
	(clone_function_decl): Adjust add_member calls.
	* decl2.c (check_classfn): Likewise.
	* method.c (lazily_declare_fn): Likewise.
	* semantics.c (finish_member_declaration): Likewise.
	
	* method.c (synthesize_method): Use inform, not warning.
	testsuite:
	PR c++/20637
	* g++.dg/inherit/using4.C: New.
	* g++.dg/overload/error1.C: Adjust expected errors.
	* g++.old-deja/g++.benjamin/warn02.C: Likewise.
	* g++.old-deja/g++.brendan/arm2.C: Likewise.
	* g++.old-deja/g++.other/redecl2.C: Likewise.
	* g++.old-deja/g++.other/redecl4.C: Likewise.
	* g++.old-deja/g++.pt/memtemp78.C: Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4776&r2=1.4777
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&r1=1.718&r2=1.719
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.1141&r2=1.1142
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&r1=1.784&r2=1.785
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/method.c.diff?cvsroot=gcc&r1=1.332&r2=1.333
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.473&r2=1.474
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5601&r2=1.5602
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/using4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/overload/error1.C.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.benjamin/warn02.C.diff?cvsroot=gcc&r1=1.4&r2=1.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.brendan/arm2.C.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.other/redecl2.C.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.other/redecl4.C.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.pt/memtemp78.C.diff?cvsroot=gcc&r1=1.3&r2=1.4



-- 


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


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

* [Bug c++/20637] [3.4/4.0 regression] Confusing message with different using declarations
  2005-03-25 16:27 [Bug c++/20637] New: [3.3/3.4/4.0/4.1 regression] Confusing message with different using declarations bangerth at dealii dot org
                   ` (4 preceding siblings ...)
  2005-06-06 14:18 ` cvs-commit at gcc dot gnu dot org
@ 2005-06-14  9:01 ` nathan at gcc dot gnu dot org
  2005-07-08  1:34 ` mmitchel at gcc dot gnu dot org
  2005-07-12 11:55 ` nathan at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: nathan at gcc dot gnu dot org @ 2005-06-14  9:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From nathan at gcc dot gnu dot org  2005-06-14 09:01 -------
Fixed on mainline, waiting for unfreeze on 4.0.
I am disinclined to backport to 3.4, it is a usability issue only.  The patch is
larger than I am comfortable with.

-- 


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


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

* [Bug c++/20637] [3.4/4.0 regression] Confusing message with different using declarations
  2005-03-25 16:27 [Bug c++/20637] New: [3.3/3.4/4.0/4.1 regression] Confusing message with different using declarations bangerth at dealii dot org
                   ` (5 preceding siblings ...)
  2005-06-14  9:01 ` [Bug c++/20637] [3.4/4.0 " nathan at gcc dot gnu dot org
@ 2005-07-08  1:34 ` mmitchel at gcc dot gnu dot org
  2005-07-12 11:55 ` nathan at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-07-08  1:34 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.1                       |4.0.2


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


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

* [Bug c++/20637] [3.4/4.0 regression] Confusing message with different using declarations
  2005-03-25 16:27 [Bug c++/20637] New: [3.3/3.4/4.0/4.1 regression] Confusing message with different using declarations bangerth at dealii dot org
                   ` (6 preceding siblings ...)
  2005-07-08  1:34 ` mmitchel at gcc dot gnu dot org
@ 2005-07-12 11:55 ` nathan at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: nathan at gcc dot gnu dot org @ 2005-07-12 11:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From nathan at gcc dot gnu dot org  2005-07-12 11:50 -------
fixed on 4.0 branch

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


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


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

end of thread, other threads:[~2005-07-12 11:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-25 16:27 [Bug c++/20637] New: [3.3/3.4/4.0/4.1 regression] Confusing message with different using declarations bangerth at dealii dot org
2005-03-25 17:13 ` [Bug c++/20637] " pinskia at gcc dot gnu dot org
2005-03-25 20:12 ` bangerth at dealii dot org
2005-03-26  4:28 ` gdr at integrable-solutions dot net
2005-06-06 13:22 ` [Bug c++/20637] [3.4/4.0/4.1 " nathan at gcc dot gnu dot org
2005-06-06 14:18 ` cvs-commit at gcc dot gnu dot org
2005-06-14  9:01 ` [Bug c++/20637] [3.4/4.0 " nathan at gcc dot gnu dot org
2005-07-08  1:34 ` mmitchel at gcc dot gnu dot org
2005-07-12 11:55 ` nathan 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).