public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/38543]  New: Cannot specialize variadic template function
@ 2008-12-16 21:41 jichaoz at ca dot ibm dot com
  2009-12-26 18:56 ` [Bug c++/38543] " paolo dot carlini at oracle dot com
  0 siblings, 1 reply; 2+ messages in thread
From: jichaoz at ca dot ibm dot com @ 2008-12-16 21:41 UTC (permalink / raw)
  To: gcc-bugs

GCC 4.3.2 failed to compile code with vairadic template function
specialization.

Here is the code causing the problem:

template< typename ... T > void foo( T ... args );
template<> void foo( int, double ){}
int main()
{
  foo( 0, 0.0 );
  return 55;
}

I got the following error msg:
test.cpp:3: error: template-id 'foo<>' for 'void foo(int, double)' does not
match any template declaration

However, the specialization using only one parameter can pass:

template< typename ... T > void foo( T ... args );
template<> void foo( int ){}
int main()
{
  foo( 0 );
  return 55;
}

Command used to compile:

g++ -std=c++0x    test.cpp   -o test

Output from -v:

Using built-in specs.
Target: powerpc64-suse-linux
Configured with: ../configure --prefix=/usr --with-local-prefix=/usr/local
--infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64
--libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3
--enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/
--with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap
--with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch --program-suffix=-4.3
--enable-version-specific-runtime-libs --enable-linux-futex
--without-system-libunwind --with-cpu=power4 --enable-secureplt
--with-long-double-128 --build=powerpc64-suse-linux
Thread model: posix
gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux)


-- 
           Summary: Cannot specialize variadic template function
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jichaoz at ca dot ibm dot com
  GCC host triplet: powerpc64-suse-linux


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


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

* [Bug c++/38543] Cannot specialize variadic template function
  2008-12-16 21:41 [Bug c++/38543] New: Cannot specialize variadic template function jichaoz at ca dot ibm dot com
@ 2009-12-26 18:56 ` paolo dot carlini at oracle dot com
  0 siblings, 0 replies; 2+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-12-26 18:56 UTC (permalink / raw)
  To: gcc-bugs



-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal


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


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

end of thread, other threads:[~2009-12-26 18:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-16 21:41 [Bug c++/38543] New: Cannot specialize variadic template function jichaoz at ca dot ibm dot com
2009-12-26 18:56 ` [Bug c++/38543] " paolo dot carlini at oracle dot com

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