public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21467] New: ICE for template function if missing required default argument
@ 2005-05-09 12:31 sylvain dot joyeux at m4x dot org
  2005-05-09 12:53 ` [Bug c++/21467] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: sylvain dot joyeux at m4x dot org @ 2005-05-09 12:31 UTC (permalink / raw)
  To: gcc-bugs

The following code makes g++ 3.4.4 and g++ 3.3.6 (Debian) crash on my system. 
Adding the missing default argument for arg1 fixes the crash 
 
template<typename F> 
void test(F function, bool arg0 = false, bool arg1) 
{ 
} 
 
int main() 
{ 
    test(main); 
} 
 
Detailed G++ versions: 
 
g++-3.3 (GCC) 3.3.6 (Debian 1:3.3.6-3) 
Reading specs from /usr/lib/gcc-lib/powerpc-linux/3.3.6/specs 
Configured with: ../src/configure -v 
--enable-languages=c,c++,java,f77,pascal,objc,ada --prefix=/usr 
--mandir=/usr/share/man --infodir=/usr/share/info 
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared 
--enable-__cxa_atexit --with-system-zlib --enable-nls 
--without-included-gettext --enable-clocale=gnu --enable-debug 
--enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc 
--disable-multilib powerpc-linux 
Thread model: posix 
gcc version 3.3.6 (Debian 1:3.3.6-3) 
 
g++-3.4 (GCC) 3.4.4 20050314 (prerelease) (Debian 3.4.3-13) 
Reading specs from /usr/lib/gcc/powerpc-linux/3.4.4/specs 
Configured with: ../src/configure -v 
--enable-languages=c,c++,java,f77,pascal,objc,ada --prefix=/usr 
--libexecdir=/usr/lib --with-gxx-include-dir=/usr/include/c++/3.4 
--enable-shared --with-system-zlib --enable-nls --without-included-gettext 
--program-suffix=-3.4 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt 
--enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm 
--enable-java-awt=gtk --disable-multilib --disable-softfloat powerpc-linux 
Thread model: posix 
gcc version 3.4.4 20050314 (prerelease) (Debian 3.4.3-13)

-- 
           Summary: ICE for template function if missing required default
                    argument
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sylvain dot joyeux at m4x dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/21467] ICE for template function if missing required default argument
  2005-05-09 12:31 [Bug c++/21467] New: ICE for template function if missing required default argument sylvain dot joyeux at m4x dot org
@ 2005-05-09 12:53 ` pinskia at gcc dot gnu dot org
  2005-05-09 14:12 ` giovannibajo at libero dot it
  2005-05-09 14:25 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-09 12:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-09 12:53 -------
Confirmed and not a regression.
Here is the backtrace:
#0  convert_default_arg (type=0xb7bf9804, arg=0x0, fn=0xb7c8c948, parmnum=2)
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/cp/call.c:4513
#1  0x0810a7c0 in build_function_call (function=0xb7c8c948, params=0x0)
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/cp/typeck.c:2618
#2  0x0805c8b9 in build_new_function_call (fn=0xb7c68e40, args=0xb7c68f30)
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/cp/call.c:2763
#3  0x08131ea0 in finish_call_expr (fn=0xb7c68e40, args=0xb7c68f30, disallow_virtual=0 '\0', 
koenig_p=1 '\001')
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/cp/semantics.c:1846
#4  0x080ef725 in cp_parser_unary_expression (parser=0xb7c8b2d8, address_p=0 '\0', cast_p=0 '\0')
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/cp/parser.c:4158
#5  0x080f0192 in cp_parser_assignment_expression (parser=0xb7c8b2d8, cast_p=0 '\0')
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/cp/parser.c:5413
#6  0x080f1939 in cp_parser_expression (parser=0xb7c8b2d8, cast_p=Variable "cast_p" is not 
available.
)


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-invalid-code
      Known to fail|                            |2.95.3 3.0.4 3.2.3 3.3.3
                   |                            |3.4.0 4.0.0
   Last reconfirmed|0000-00-00 00:00:00         |2005-05-09 12:53:37
               date|                            |
            Summary|ICE for template function if|ICE for template function if
                   |missing required default    |missing required default
                   |argument                    |argument


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


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

* [Bug c++/21467] ICE for template function if missing required default argument
  2005-05-09 12:31 [Bug c++/21467] New: ICE for template function if missing required default argument sylvain dot joyeux at m4x dot org
  2005-05-09 12:53 ` [Bug c++/21467] " pinskia at gcc dot gnu dot org
@ 2005-05-09 14:12 ` giovannibajo at libero dot it
  2005-05-09 14:25 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: giovannibajo at libero dot it @ 2005-05-09 14:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2005-05-09 14:03 -------
The real bug is this accepts-invalid:

--------------------------------------------
template<typename F> 
void test(F function, bool arg0 = false, bool arg1) 
{} 
--------------------------------------------

The ICE when you call the function is just a fallout of not having properly 
validated the parameter declarations.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid


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


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

* [Bug c++/21467] ICE for template function if missing required default argument
  2005-05-09 12:31 [Bug c++/21467] New: ICE for template function if missing required default argument sylvain dot joyeux at m4x dot org
  2005-05-09 12:53 ` [Bug c++/21467] " pinskia at gcc dot gnu dot org
  2005-05-09 14:12 ` giovannibajo at libero dot it
@ 2005-05-09 14:25 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-09 14:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-09 14:22 -------


*** This bug has been marked as a duplicate of 16829 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2005-05-09 14:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-09 12:31 [Bug c++/21467] New: ICE for template function if missing required default argument sylvain dot joyeux at m4x dot org
2005-05-09 12:53 ` [Bug c++/21467] " pinskia at gcc dot gnu dot org
2005-05-09 14:12 ` giovannibajo at libero dot it
2005-05-09 14:25 ` pinskia 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).