This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13088] templatizing outer class hides specialization of inner template class
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Nov 2003 22:00:48 -0000
- Subject: [Bug c++/13088] templatizing outer class hides specialization of inner template class
- References: <20031117182653.13088.cppljevans@cox-internet.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2003-11-17 22:00 -------
You boost guys really have ways to write totally incomprehensible
testcases...
Anyway, the claim is justified, I guess. In essence, this boils down to
------------------
#include <iostream>
template <typename> struct S {
template <typename> struct Type {};
};
template <typename> struct X {
template <typename> struct Local;
};
template <typename U>
template <typename>
struct X<U>::Local {
static void id() { std::cout << "primary\n" ;}
};
template <typename U>
template <typename T>
struct X<U>::Local<typename S<U>::template Type<T> > {
static void id() { std::cout << "specialized\n" ;}
};
int main() {
X<int>::Local<S<int>::Type<int> >::id();
}
-------------------------------
For this, we get
g/x> /home/bangerth/bin/gcc-3.3.2/bin/c++ x.cc ; ./a.out
primary
The same holds for every other gcc version that doesn't ICE outright. On
the other hand, icc for example prints "specialized". I guess it's wrong
that we don't match the partial specialization of X::Local.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-11-17 22:00:47
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13088