From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17283 invoked by alias); 3 Jan 2003 12:16:08 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 17261 invoked by uid 71); 3 Jan 2003 12:16:06 -0000 Date: Fri, 03 Jan 2003 12:16:00 -0000 Message-ID: <20030103121606.17260.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Nathanael Nerode Subject: Re: c++/4205 Reply-To: Nathanael Nerode X-SW-Source: 2003-01/txt/msg00191.txt.bz2 List-Id: The following reply was made to PR c++/4205; it has been noted by GNATS. From: Nathanael Nerode To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, Jens.Maurer@gmx.net, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: c++/4205 Date: Fri, 3 Jan 2003 07:07:54 -0500 This has a further perverse piece of behavior not noted before: the following code will, correctly, give an error! -- template void quirk(F f) { (*f) (1); } // void foo(int i, int j = 5){} void bar(int i, int j) {} int main() { // quirk(&foo); quirk(&bar); } -- And so will this: -- template void quirk(F f) { (*f) (1); } void foo(int i, int j = 5){} void bar(int i, int j) {} int main() { quirk(&bar); quirk(&foo); } -- As long as "foo" is seen *first*, it 'immunizes' all subsequent functions. But not otherwise. This is really bad behavior. It may possibly be related to c++/3784, which has similar "first one seen controls everyone else" behavior, though I doubt it.