public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
@ 2003-08-13 18:27 ` ehrhardt at mathematik dot uni-ulm dot de
  2003-08-13 18:28 ` ehrhardt at mathematik dot uni-ulm dot de
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: ehrhardt at mathematik dot uni-ulm dot de @ 2003-08-13 18:27 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=6628


ehrhardt at mathematik dot uni-ulm dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-13 18:27:52
               date|                            |


------- Additional Comments From ehrhardt at mathematik dot uni-ulm dot de  2003-08-13 18:27 -------
Reopened based on http://gcc.gnu.org/ml/gcc-bugs/2003-08/msg01573.html:

The following piece of code taken directly from the standard (9.3)
shows that the typedef should be legal.
============= cut =====================
typedef void fv(void);
typedef void fvc(void) const;
struct S {
	fv memfunc1; // equivalent to: void memfunc1(void);
	void memfunc2();
	fvc memfunc3; // equivalent to: void memfunc3(void) const;
};
fv S::* pmfv1 = &S::memfunc1;
fv S::* pmfv2 = &S::memfunc2;
fvc S::* pmfv3 = &S::memfunc3;
============= cut =====================

However, current mainline gives the following error:
thales$ ~/gcc-3.4-cvs/install/bin/g++ 6628.cc 
6628.cc:2: error: invalid type qualifier for non-member function type
6628.cc:2: error: `const' and `volatile' function specifiers on `fvc' invalid 
   in type declaration

   regards  Christian


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

* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
  2003-08-13 18:27 ` [Bug c++/6628] cannot typedef const functions ehrhardt at mathematik dot uni-ulm dot de
@ 2003-08-13 18:28 ` ehrhardt at mathematik dot uni-ulm dot de
  2003-08-13 19:17 ` pinskia at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: ehrhardt at mathematik dot uni-ulm dot de @ 2003-08-13 18:28 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=6628


ehrhardt at mathematik dot uni-ulm dot de changed:

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


------- Additional Comments From ehrhardt at mathematik dot uni-ulm dot de  2003-08-13 18:28 -------
.


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

* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
                   ` (2 preceding siblings ...)
  2003-08-13 19:17 ` pinskia at gcc dot gnu dot org
@ 2003-08-13 19:17 ` pinskia at gcc dot gnu dot org
  2003-08-23 15:31 ` pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-13 19: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=6628


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEW


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

* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
  2003-08-13 18:27 ` [Bug c++/6628] cannot typedef const functions ehrhardt at mathematik dot uni-ulm dot de
  2003-08-13 18:28 ` ehrhardt at mathematik dot uni-ulm dot de
@ 2003-08-13 19:17 ` pinskia at gcc dot gnu dot org
  2003-08-13 19:17 ` pinskia at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-13 19: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=6628


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
   Last reconfirmed|2003-08-13 18:27:52         |2003-08-13 19:17:08
               date|                            |


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

* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
                   ` (3 preceding siblings ...)
  2003-08-13 19:17 ` pinskia at gcc dot gnu dot org
@ 2003-08-23 15:31 ` pinskia at gcc dot gnu dot org
  2004-01-16  3:57 ` giovannibajo at libero dot it
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-23 15:31 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=6628


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
   Last reconfirmed|2003-08-13 19:17:08         |2003-08-23 15:31:54
               date|                            |


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

* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
                   ` (4 preceding siblings ...)
  2003-08-23 15:31 ` pinskia at gcc dot gnu dot org
@ 2004-01-16  3:57 ` giovannibajo at libero dot it
  2004-04-02 15:03 ` nathan at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-16  3:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-01-16 03:57 -------
Basically a duplicate of 10807. I'll keep both open and connected to make sure 
we test all the possibile cases, but the patch will most likely be the same.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |10807


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


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

* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
                   ` (5 preceding siblings ...)
  2004-01-16  3:57 ` giovannibajo at libero dot it
@ 2004-04-02 15:03 ` nathan at gcc dot gnu dot org
  2004-04-05 15:54 ` nathan at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: nathan at gcc dot gnu dot org @ 2004-04-02 15:03 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 6628 depends on bug 10807, which changed state.

Bug 10807 Summary: [DR 295] It should be possible to cv-qualify function types, if the CV qualifications are introduced through a typedef or a template argument
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10807

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

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


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

* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
                   ` (6 preceding siblings ...)
  2004-04-02 15:03 ` nathan at gcc dot gnu dot org
@ 2004-04-05 15:54 ` nathan at gcc dot gnu dot org
  2004-04-05 15:55 ` nathan at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: nathan at gcc dot gnu dot org @ 2004-04-05 15:54 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 6628 depends on bug 10807, which changed state.

Bug 10807 Summary: [DR 295] It should be possible to cv-qualify function types, if the CV qualifications are introduced through a typedef or a template argument
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10807

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |

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


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

* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
                   ` (7 preceding siblings ...)
  2004-04-05 15:54 ` nathan at gcc dot gnu dot org
@ 2004-04-05 15:55 ` nathan at gcc dot gnu dot org
  2004-08-05  2:50 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: nathan at gcc dot gnu dot org @ 2004-04-05 15:55 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 6628 depends on bug 10807, which changed state.

Bug 10807 Summary: [DR 295] It should be possible to cv-qualify function types, if the CV qualifications are introduced through a typedef or a template argument
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10807

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED

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


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

* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
                   ` (8 preceding siblings ...)
  2004-04-05 15:55 ` nathan at gcc dot gnu dot org
@ 2004-08-05  2:50 ` pinskia at gcc dot gnu dot org
  2004-08-05 14:24 ` bangerth at dealii dot org
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-05  2:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-05 02:50 -------
Hmm, this is still not fixed and it looks like the fix for PR 10807 did not change anything for the 
example but then again there might be a DR about this problem.

-- 


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


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

* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
                   ` (9 preceding siblings ...)
  2004-08-05  2:50 ` pinskia at gcc dot gnu dot org
@ 2004-08-05 14:24 ` bangerth at dealii dot org
  2005-01-03 21:44 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: bangerth at dealii dot org @ 2004-08-05 14:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-08-05 14:24 -------
The exact place in the standard is 9.3/9, btw. 
 
It's not up to me, but I think this syntax is gross. The declaration 
of member functions this way looks exactly like the declaration 
of a member variable of type pointer-to-function :-( 
 
W. 

-- 


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


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

* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
                   ` (10 preceding siblings ...)
  2004-08-05 14:24 ` bangerth at dealii dot org
@ 2005-01-03 21:44 ` pinskia at gcc dot gnu dot org
  2005-01-03 21:47 ` austern at apple dot com
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-03 21:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-03 21:43 -------
*** Bug 19245 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |austern at apple dot com


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


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

* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
                   ` (11 preceding siblings ...)
  2005-01-03 21:44 ` pinskia at gcc dot gnu dot org
@ 2005-01-03 21:47 ` austern at apple dot com
  2005-01-26 10:27 ` pcarlini at suse dot de
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 16+ messages in thread
From: austern at apple dot com @ 2005-01-03 21:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From austern at apple dot com  2005-01-03 21:46 -------
9.3/9 isn't the most relevant part of the standard.  Yes, that gives an example showing that this syntax 
is legal, but examples are non-normative.  They're mostly useful for establishing the intent of the 
committee.

The relevant normative text is in 8.3.5/4, which makes it quite clear that cv-qualifiers are allowed in 
typedefs for function types and which explains what they mean.

-- 


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


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

* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
                   ` (12 preceding siblings ...)
  2005-01-03 21:47 ` austern at apple dot com
@ 2005-01-26 10:27 ` pcarlini at suse dot de
  2005-02-22  4:02 ` cvs-commit at gcc dot gnu dot org
  2005-02-22  6:27 ` pcarlini at suse dot de
  15 siblings, 0 replies; 16+ messages in thread
From: pcarlini at suse dot de @ 2005-01-26 10:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-01-26 10:27 -------
Patch here: http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01627.html

-- 


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


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

* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
                   ` (13 preceding siblings ...)
  2005-01-26 10:27 ` pcarlini at suse dot de
@ 2005-02-22  4:02 ` cvs-commit at gcc dot gnu dot org
  2005-02-22  6:27 ` pcarlini at suse dot de
  15 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-02-22  4:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-02-21 23:12 -------
Subject: Bug 6628

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	paolo@gcc.gnu.org	2005-02-21 23:12:28

Modified files:
	gcc/cp         : ChangeLog cp-tree.h decl.c decl2.c error.c pt.c 
	                 tree.c typeck.c 

Log message:
	2005-02-21  Douglas Gregor  <dgregor@cs.indiana.edu>
	
	PR c++/19076
	PR c++/6628
	* cp-tree.h (cp_apply_type_quals_to_decl): Declared.
	* decl.c (grokdeclarator): Pedwarn about qualifying a function
	type.
	Add qualifiers when declaring a typedef of a function type.
	Member function pointers pick up the qualifiers of the typedef
	used to declare them.
	Don't complain about creating cv-qualified function types.
	Complain about qualified function typedefs that are used to
	declare non-static member functions or free functions.
	Use cp_apply_type_quals_to_decl.
	(start_preparsed_function): Use cp_apply_type_quals_to_decl.
	(grokclassfn): Use cp_apply_type_quals_to_decl.
	* error.c (dump_type_suffix): Print qualifiers for function
	types.
	* pt.c (tsubst_decl): Use cp_apply_type_quals_to_decl.
	(tsubst): When substituting a function type into a member
	pointer type, pass along the qualifiers.
	(unify): Unify member pointers to member function pointers.
	* tree.c (cp_build_qualified_type_real): Function types may be
	qualified. This includes restrict qualifiers.
	* typeck.c (cp_apply_type_quals_to_decl): New function to replace
	use of c_apply_type_quals_to_decl. Drops qualifiers that are being
	added to function types.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4639&r2=1.4640
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.1104&r2=1.1105
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1366&r2=1.1367
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&r1=1.767&r2=1.768
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/error.c.diff?cvsroot=gcc&r1=1.275&r2=1.276
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.977&r2=1.978
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/tree.c.diff?cvsroot=gcc&r1=1.426&r2=1.427
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.614&r2=1.615



-- 


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


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

* [Bug c++/6628] cannot typedef const functions
       [not found] <20020510135600.6628.ge@cs.twsu.edu>
                   ` (14 preceding siblings ...)
  2005-02-22  4:02 ` cvs-commit at gcc dot gnu dot org
@ 2005-02-22  6:27 ` pcarlini at suse dot de
  15 siblings, 0 replies; 16+ messages in thread
From: pcarlini at suse dot de @ 2005-02-22  6:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-02-21 23:39 -------
Fixed for 4.0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


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


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

end of thread, other threads:[~2005-02-21 23:39 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20020510135600.6628.ge@cs.twsu.edu>
2003-08-13 18:27 ` [Bug c++/6628] cannot typedef const functions ehrhardt at mathematik dot uni-ulm dot de
2003-08-13 18:28 ` ehrhardt at mathematik dot uni-ulm dot de
2003-08-13 19:17 ` pinskia at gcc dot gnu dot org
2003-08-13 19:17 ` pinskia at gcc dot gnu dot org
2003-08-23 15:31 ` pinskia at gcc dot gnu dot org
2004-01-16  3:57 ` giovannibajo at libero dot it
2004-04-02 15:03 ` nathan at gcc dot gnu dot org
2004-04-05 15:54 ` nathan at gcc dot gnu dot org
2004-04-05 15:55 ` nathan at gcc dot gnu dot org
2004-08-05  2:50 ` pinskia at gcc dot gnu dot org
2004-08-05 14:24 ` bangerth at dealii dot org
2005-01-03 21:44 ` pinskia at gcc dot gnu dot org
2005-01-03 21:47 ` austern at apple dot com
2005-01-26 10:27 ` pcarlini at suse dot de
2005-02-22  4:02 ` cvs-commit at gcc dot gnu dot org
2005-02-22  6:27 ` pcarlini at suse dot de

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