public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13113] New: [3.4 regression] Nice warning about &(X::m) lost
@ 2003-11-18 20:23 bangerth at dealii dot org
  2003-11-18 20:27 ` [Bug c++/13113] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2003-11-18 20:23 UTC (permalink / raw)
  To: gcc-bugs

Sometime in the 3.2 series, a nice warning was introduced for
code like this:
--------------------
struct A {
    int f();
};

int (A::*p)() = &(A::f);
---------------------

g/x> /home/bangerth/bin/gcc-3.2.3/bin/c++ -c x.cc
x.cc:5: parenthesis around 'A::f()' cannot be used to form a
   pointer-to-member-function

This got lost with the new parser, which now says

g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc:5: error: invalid use of non-static member function `int A::f()'

-- 
           Summary: [3.4 regression] Nice warning about &(X::m) lost
           Product: gcc
           Version: 3.4
            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=13113


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

* [Bug c++/13113] [3.4 regression] Nice warning about &(X::m) lost
  2003-11-18 20:23 [Bug c++/13113] New: [3.4 regression] Nice warning about &(X::m) lost bangerth at dealii dot org
@ 2003-11-18 20:27 ` pinskia at gcc dot gnu dot org
  2003-11-20  3:11 ` gdr at integrable-solutions dot net
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-18 20:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-18 20:27 -------
I can confirm this, I had meant to file this on after closing a different bug last night after seeing it 
did not ICE any more.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-11-18 20:27:25
               date|                            |
   Target Milestone|---                         |3.4


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


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

* [Bug c++/13113] [3.4 regression] Nice warning about &(X::m) lost
  2003-11-18 20:23 [Bug c++/13113] New: [3.4 regression] Nice warning about &(X::m) lost bangerth at dealii dot org
  2003-11-18 20:27 ` [Bug c++/13113] " pinskia at gcc dot gnu dot org
@ 2003-11-20  3:11 ` gdr at integrable-solutions dot net
  2004-01-10 23:06 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gdr at integrable-solutions dot net @ 2003-11-20  3:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2003-11-20 03:10 -------
Subject: Re:  New: [3.4 regression] Nice warning about &(X::m) lost

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

| Sometime in the 3.2 series, a nice warning was introduced for
| code like this:
| --------------------
| struct A {
|     int f();
| };
| 
| int (A::*p)() = &(A::f);
| ---------------------
| 
| g/x> /home/bangerth/bin/gcc-3.2.3/bin/c++ -c x.cc
| x.cc:5: parenthesis around 'A::f()' cannot be used to form a
|    pointer-to-member-function
| 
| This got lost with the new parser, which now says

:-(  That warning was part of the job of resolve_offset_xxx -- which
used to ICE on such code.  
I wish the cp/error.c display 'A::f' instead of the silly 'A::f()',
but it is something that seemseasier to do with the new
pretty-printer.

-- Gaby


-- 


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


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

* [Bug c++/13113] [3.4 regression] Nice warning about &(X::m) lost
  2003-11-18 20:23 [Bug c++/13113] New: [3.4 regression] Nice warning about &(X::m) lost bangerth at dealii dot org
  2003-11-18 20:27 ` [Bug c++/13113] " pinskia at gcc dot gnu dot org
  2003-11-20  3:11 ` gdr at integrable-solutions dot net
@ 2004-01-10 23:06 ` pinskia at gcc dot gnu dot org
  2004-01-12 20:06 ` bangerth at dealii dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-10 23:06 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.0                       |3.4.1


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


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

* [Bug c++/13113] [3.4 regression] Nice warning about &(X::m) lost
  2003-11-18 20:23 [Bug c++/13113] New: [3.4 regression] Nice warning about &(X::m) lost bangerth at dealii dot org
                   ` (2 preceding siblings ...)
  2004-01-10 23:06 ` pinskia at gcc dot gnu dot org
@ 2004-01-12 20:06 ` bangerth at dealii dot org
  2004-01-31  3:20 ` [Bug c++/13113] [3.4/3.5 " mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2004-01-12 20:06 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.1                       |3.4.0


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


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

* [Bug c++/13113] [3.4/3.5 regression] Nice warning about &(X::m) lost
  2003-11-18 20:23 [Bug c++/13113] New: [3.4 regression] Nice warning about &(X::m) lost bangerth at dealii dot org
                   ` (3 preceding siblings ...)
  2004-01-12 20:06 ` bangerth at dealii dot org
@ 2004-01-31  3:20 ` mmitchel at gcc dot gnu dot org
  2004-02-02 16:26 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-01-31  3:20 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=13113


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

* [Bug c++/13113] [3.4/3.5 regression] Nice warning about &(X::m) lost
  2003-11-18 20:23 [Bug c++/13113] New: [3.4 regression] Nice warning about &(X::m) lost bangerth at dealii dot org
                   ` (4 preceding siblings ...)
  2004-01-31  3:20 ` [Bug c++/13113] [3.4/3.5 " mmitchel at gcc dot gnu dot org
@ 2004-02-02 16:26 ` cvs-commit at gcc dot gnu dot org
  2004-02-02 16:42 ` mmitchel at gcc dot gnu dot org
  2004-02-02 16:53 ` cvs-commit at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-02 16:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-02 16:26 -------
Subject: Bug 13113

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-02-02 16:26:47

Modified files:
	gcc/cp         : ChangeLog call.c class.c cp-tree.h decl.c 
	                 init.c pt.c tree.c typeck.c 
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/g++.old-deja/g++.mike: net36.C 
Added files:
	gcc/testsuite/g++.dg/conversion: op2.C 
	gcc/testsuite/g++.dg/ext: attrib13.C 

Log message:
	PR c++/13113
	* init.c (build_offset_ref): Improve error recovery for invalid
	uses of non-static member functions.
	
	PR c++/13854
	* cp-tree.h (cp_build_type_attribute_variant): New function.
	* class.c (build_clone): Use cp_build_type_attribute_variant.
	* decl.c (duplicate_decls): Likewise.
	* pt.c (copy_default_args_to_explicit_spec): Likewise.
	(tsubst_function_type): Likewise.
	* tree.c (build_exception_variant): Check attributes before
	concluding that two types are the same.
	(cp_build_type-attribute_variant): New method.
	* typeck.c (merge_types): Use cp_build_type_attribute_variant.
	
	PR c++/13907
	* call.c (convert_class_to_reference): Keep better track of
	pedantically invalid user-defined conversions.
	
	PR c++/13113
	* g++.old-deja/g++.mike/net36.C: Adjust error messages.
	
	PR c++/13854
	* g++.dg/ext/attrib13.C: New test.
	
	PR c++/13907
	* g++.dg/conversion/op2.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.26&r2=1.3892.2.27
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.452.2.4&r2=1.452.2.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.595.4.3&r2=1.595.4.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.946.4.2&r2=1.946.4.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.1174.2.2&r2=1.1174.2.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.356.2.3&r2=1.356.2.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.6&r2=1.816.2.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/tree.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.360&r2=1.360.4.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.519.2.3&r2=1.519.2.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.39&r2=1.3389.2.40
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/conversion/op2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/attrib13.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.mike/net36.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.7&r2=1.7.14.1



-- 


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


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

* [Bug c++/13113] [3.4/3.5 regression] Nice warning about &(X::m) lost
  2003-11-18 20:23 [Bug c++/13113] New: [3.4 regression] Nice warning about &(X::m) lost bangerth at dealii dot org
                   ` (5 preceding siblings ...)
  2004-02-02 16:26 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-02 16:42 ` mmitchel at gcc dot gnu dot org
  2004-02-02 16:53 ` cvs-commit at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-02-02 16:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-02-02 16:42 -------
Fixed in GCC 3.4 and GCC 3.5.

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


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


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

* [Bug c++/13113] [3.4/3.5 regression] Nice warning about &(X::m) lost
  2003-11-18 20:23 [Bug c++/13113] New: [3.4 regression] Nice warning about &(X::m) lost bangerth at dealii dot org
                   ` (6 preceding siblings ...)
  2004-02-02 16:42 ` mmitchel at gcc dot gnu dot org
@ 2004-02-02 16:53 ` cvs-commit at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-02 16:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-02 16:53 -------
Subject: Bug 13113

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-02-02 16:53:17

Modified files:
	gcc/cp         : ChangeLog call.c class.c cp-tree.h decl.c 
	                 init.c pt.c tree.c typeck.c 
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/g++.old-deja/g++.mike: net36.C 
Added files:
	gcc/testsuite/g++.dg/conversion: op2.C 
	gcc/testsuite/g++.dg/ext: attrib13.C 

Log message:
	PR c++/13113
	* init.c (build_offset_ref): Improve error recovery for invalid
	uses of non-static member functions.
	
	PR c++/13854
	* cp-tree.h (cp_build_type_attribute_variant): New function.
	* class.c (build_clone): Use cp_build_type_attribute_variant.
	* decl.c (duplicate_decls): Likewise.
	* pt.c (copy_default_args_to_explicit_spec): Likewise.
	(tsubst_function_type): Likewise.
	* tree.c (build_exception_variant): Check attributes before
	concluding that two types are the same.
	(cp_build_type-attribute_variant): New method.
	* typeck.c (merge_types): Use cp_build_type_attribute_variant.
	
	PR c++/13907
	* call.c (convert_class_to_reference): Keep better track of
	pedantically invalid user-defined conversions.
	
	PR c++/13113
	* g++.old-deja/g++.mike/net36.C: Adjust error messages.
	
	PR c++/13854
	* g++.dg/ext/attrib13.C: New test.
	
	PR c++/13907
	* g++.dg/conversion/op2.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3924&r2=1.3925
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.456&r2=1.457
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&r1=1.599&r2=1.600
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.948&r2=1.949
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1178&r2=1.1179
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&r1=1.359&r2=1.360
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.824&r2=1.825
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/tree.c.diff?cvsroot=gcc&r1=1.361&r2=1.362
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.523&r2=1.524
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3451&r2=1.3452
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/conversion/op2.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/attrib13.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.mike/net36.C.diff?cvsroot=gcc&r1=1.7&r2=1.8



-- 


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


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

end of thread, other threads:[~2004-02-02 16:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-18 20:23 [Bug c++/13113] New: [3.4 regression] Nice warning about &(X::m) lost bangerth at dealii dot org
2003-11-18 20:27 ` [Bug c++/13113] " pinskia at gcc dot gnu dot org
2003-11-20  3:11 ` gdr at integrable-solutions dot net
2004-01-10 23:06 ` pinskia at gcc dot gnu dot org
2004-01-12 20:06 ` bangerth at dealii dot org
2004-01-31  3:20 ` [Bug c++/13113] [3.4/3.5 " mmitchel at gcc dot gnu dot org
2004-02-02 16:26 ` cvs-commit at gcc dot gnu dot org
2004-02-02 16:42 ` mmitchel at gcc dot gnu dot org
2004-02-02 16:53 ` cvs-commit 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).