This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16934] New: template-in-the-template explicit specialization, problem with inlined
- From: "hidden_peak at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Aug 2004 12:03:45 -0000
- Subject: [Bug c++/16934] New: template-in-the-template explicit specialization, problem with inlined
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Compiler report error for following code:
struct A
{
private:
struct B
{
template <typename T>
static void f( T& ) {}
template <bool V>
struct C
{
template <typename T>
static void f( T& ) {}
};
template <>
struct C<true>
{
template <typename T>
static void f( T& ) {}
};
};
};
> c++ -pthread -fexceptions -fident -v -save-temps ttei3.cpp
Reading specs from /opt/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/specs
Configured with: ./configure --prefix=/opt/gcc-3.4.1 --enable-threads
--enable-languages=c,c++
Thread model: posix
gcc version 3.4.1
/opt/gcc-3.4.1/libexec/gcc/i686-pc-linux-gnu/3.4.1/cc1plus -E -quiet -v
-D_GNU_SOURCE -D_REENTRANT ttei3.cpp -mtune=pentiumpro -fexceptions
-fident -o ttei3.ii
ignoring nonexistent directory
"/opt/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/opt/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/../../../../include/c++/3.4.1
/opt/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/../../../../include/c++/3.4.1/i686-pc-linux-gnu
/opt/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/../../../../include/c++/3.4.1/backward
/usr/local/include
/opt/gcc-3.4.1/include
/opt/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/include
/usr/include
End of search list.
/opt/gcc-3.4.1/libexec/gcc/i686-pc-linux-gnu/3.4.1/cc1plus -fpreprocessed ttei3.ii
-quiet -dumpbase ttei3.cpp -mtune=pentiumpro -auxbase ttei3 -version -fexceptions
-fident -o ttei3.s
GNU C++ version 3.4.1 (i686-pc-linux-gnu)
compiled by GNU C version 3.3.3.
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=129097
ttei3.cpp:26: error: invalid explicit specialization before '>' token
ttei3.cpp:26: error: explicit specialization in non-namespace scope `struct A::B'
If explicit specialization will be out-of-class, all will be fine:
struct A
{
private:
struct B
{
template <typename T>
static void f( T& ) {}
template <bool V>
struct C
{
template <typename T>
static void f( T& ) {}
};
};
};
template <> template <typename T>
void A::B::C<true>::f( T& ) {}
--
Summary: template-in-the-template explicit specialization,
problem with inlined
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hidden_peak at mail dot ru
CC: gcc-bugs at gcc dot gnu dot org,hidden_peak at mail dot
ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16934