Bug 102 - C++ bug in __builtin_apply()
Summary: C++ bug in __builtin_apply()
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 2.95.2
: P3 normal
Target Milestone: ---
Assignee: Gabriel Dos Reis
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2000-03-12 10:36 UTC by martin
Modified: 2005-10-11 21:30 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description martin 2000-03-12 10:36:00 UTC
 Date: Mon, 13 Mar 2000 00:49:57 +1100
 Original-Message-Id: <20000312134957.506922F02A@sharedtech.eyep.net>


 The following compiles under gcc, but results in the following error under g++:

 Errors:
 g++ -o apply1 apply1.c
 apply1.c: In function `void fn(int)':
 apply1.c:5: argument passing to `void * ()(unsigned int)' from `void *'

 Code:
 extern void fn1();
 void fn (int b){
	 __builtin_apply( (void (*)())fn1,
			  __builtin_apply_args(),
			  32);
 }

Release:
2.95.2
Comment 1 Gabriel Dos Reis 2001-02-21 05:12:05 UTC
Responsible-Changed-From-To: unassigned->gdr
Responsible-Changed-Why: In charge.
Comment 2 Gabriel Dos Reis 2001-02-21 05:12:05 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: This is not a bug. Mainline and gcc-3_0-branch produce
    
    102.C: In function `void fn(int)':
    102.C:5: cannot convert `void (*)()' to `void (*)(...)' for argument `1' to 
       `void* __builtin_apply(void (*)(...), void*, unsigned int)'
    
    which seems to indicate that the first argument should be
    of type void (*)(...).
    
    Indeed rewriting the first argument of __builtin_apply
    as (void (*)(...))fn1 solves the problem.
    
    -- Gaby
Comment 3 Gabriel Dos Reis 2001-02-21 13:12:06 UTC
From: gdr@gcc.gnu.org
To: colin@field.medicine.adelaide.edu.au, gcc-gnats@gcc.gnu.org,
  gdr@gcc.gnu.org, martin@loewis.home.cs.tu-berlin.de, nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/102
Date: 21 Feb 2001 13:12:06 -0000

 Synopsis: C++ bug in __builtin_apply()
 
 Responsible-Changed-From-To: unassigned->gdr
 Responsible-Changed-By: gdr
 Responsible-Changed-When: Wed Feb 21 05:12:05 2001
 Responsible-Changed-Why:
     In charge.
 State-Changed-From-To: analyzed->closed
 State-Changed-By: gdr
 State-Changed-When: Wed Feb 21 05:12:05 2001
 State-Changed-Why:
     This is not a bug. Mainline and gcc-3_0-branch produce
     
     102.C: In function `void fn(int)':
     102.C:5: cannot convert `void (*)()' to `void (*)(...)' for argument `1' to 
        `void* __builtin_apply(void (*)(...), void*, unsigned int)'
     
     which seems to indicate that the first argument should be
     of type void (*)(...).
     
     Indeed rewriting the first argument of __builtin_apply
     as (void (*)(...))fn1 solves the problem.
     
     -- Gaby
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=102&database=gcc
Comment 4 Andrew Pinski 2005-10-11 21:29:58 UTC
Reopening to ...
Comment 5 Andrew Pinski 2005-10-11 21:30:34 UTC
To close as invalid per comment #2 and #3.