public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/8503: strange behaviour of function types.
@ 2002-11-09  7:09 paolo
  0 siblings, 0 replies; 6+ messages in thread
From: paolo @ 2002-11-09  7:09 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, john_maddock, nobody

Synopsis: strange behaviour of function types.

State-Changed-From-To: open->analyzed
State-Changed-By: paolo
State-Changed-When: Sat Nov  9 07:09:50 2002
State-Changed-Why:
    Current mainline is Ok:
    paolo:~> a.out
    non-const
    non-const
    non-const
    On the other hand, 3_2-branch is affected by the bug:
    paolo:~> a.out
    const
    const
    const
    Regression from 3.0.4 -> high priority.

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


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

* Re: c++/8503: strange behaviour of function types.
@ 2002-11-09  7:01 paolo
  0 siblings, 0 replies; 6+ messages in thread
From: paolo @ 2002-11-09  7:01 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, john_maddock, nobody, paolo

Synopsis: strange behaviour of function types.

Responsible-Changed-From-To: paolo->unassigned
Responsible-Changed-By: paolo
Responsible-Changed-When: Sat Nov  9 07:01:14 2002
Responsible-Changed-Why:
    .

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


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

* Re: c++/8503: strange behaviour of function types.
@ 2002-11-09  7:00 paolo
  0 siblings, 0 replies; 6+ messages in thread
From: paolo @ 2002-11-09  7:00 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, john_maddock, paolo

Synopsis: strange behaviour of function types.

State-Changed-From-To: feedback->open
State-Changed-By: paolo
State-Changed-When: Sat Nov  9 07:00:28 2002
State-Changed-Why:
    Testcase received.

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


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

* Re: c++/8503: strange behaviour of function types.
@ 2002-11-09  3:56 John Maddock
  0 siblings, 0 replies; 6+ messages in thread
From: John Maddock @ 2002-11-09  3:56 UTC (permalink / raw)
  To: paolo; +Cc: gcc-prs

The following reply was made to PR c++/8503; it has been noted by GNATS.

From: "John Maddock" <john_maddock@compuserve.com>
To: <paolo@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>,
	<john_maddock@compuserve.com>,
	<nobody@gcc.gnu.org>,
	<gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: c++/8503: strange behaviour of function types.
Date: Sat, 9 Nov 2002 11:20:17 -0000

 This is a multi-part message in MIME format.
 
 ------=_NextPart_000_0026_01C287E1.FB7F23C0
 Content-Type: text/plain;
 	charset="iso-8859-1"
 Content-Transfer-Encoding: 7bit
 
 >     Unfortunately, the example code got lost.
 >     Could you possibly send it to me privately? I will complete
 >     the PR with it.
 >     Thanks, Paolo.
 
 See attached.
 ------=_NextPart_000_0026_01C287E1.FB7F23C0
 Content-Type: application/octet-stream;
 	name="Gcc_bug.cpp"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="Gcc_bug.cpp"
 
 
 #include <iostream>
 
 template <class T>
 struct is_const
 {
 	static void check()
 	{ std::cout << "non-const\n"; }
 };
 
 template <class T>
 struct is_const<T const>
 {
 	static void check()
 	{ std::cout << "const\n"; }
 };
 
 template <class T>
 void overload_reference(T&)
 {std::cout << "non-const\n"; }
 
 template <class T>
 void overload_reference(const volatile T&)
 {std::cout << "const\n"; }
 
 template <class T>
 void overload_pointer(T*)
 {std::cout << "non-const\n"; }
 
 template <class T>
 void overload_pointer(const volatile T*)
 {std::cout << "const\n"; }
 
 int sample_proc(int)
 {
 return 0;
 }
 
 int main()
 {
 	typedef int (foo_type)(int);
 	is_const<foo_type>::check();
 	foo_type& f = sample_proc;
 	overload_reference(f);
 	foo_type* pf = &f;
 	overload_pointer(pf);
 }
 
 
 
 ------=_NextPart_000_0026_01C287E1.FB7F23C0--
 
 


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

* Re: c++/8503: strange behaviour of function types.
@ 2002-11-08  5:07 paolo
  0 siblings, 0 replies; 6+ messages in thread
From: paolo @ 2002-11-08  5:07 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, john_maddock, nobody, paolo

Synopsis: strange behaviour of function types.

Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-By: paolo
Responsible-Changed-When: Fri Nov  8 05:07:17 2002
Responsible-Changed-Why:
    .
State-Changed-From-To: open->feedback
State-Changed-By: paolo
State-Changed-When: Fri Nov  8 05:07:17 2002
State-Changed-Why:
    Unfortunately, the example code got lost.
    Could you possibly send it to me privately? I will complete
    the PR with it.
    Thanks, Paolo.

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


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

* c++/8503: strange behaviour of function types.
@ 2002-11-08  4:46 john_maddock
  0 siblings, 0 replies; 6+ messages in thread
From: john_maddock @ 2002-11-08  4:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8503
>Category:       c++
>Synopsis:       strange behaviour of function types.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 08 04:46:03 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     John Maddock
>Release:        gcc-3.2
>Organization:
>Environment:
Suse Linux 7.0
>Description:
The example code attached behaves strangely with function types, basically template argument deduction finds cv-qualified reference or pointer to function overloads, rather than the non-cv qualified version. Since cv-qualifiers are illegal on function types this is particular annoying (in fact gcc emits a warning about this).  template partial specializations behave in the same way - and this is currently causing a problem for boost's type traits code.
>How-To-Repeat:

>Fix:

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


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

end of thread, other threads:[~2002-11-09 15:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-09  7:09 c++/8503: strange behaviour of function types paolo
  -- strict thread matches above, loose matches on Subject: below --
2002-11-09  7:01 paolo
2002-11-09  7:00 paolo
2002-11-09  3:56 John Maddock
2002-11-08  5:07 paolo
2002-11-08  4:46 john_maddock

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