This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11972] [3.4 regression] problem finding nested types in templates
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Aug 2003 21:43:49 -0000
- Subject: [Bug c++/11972] [3.4 regression] problem finding nested types in templates
- References: <20030818211357.11972.poschmid@lbl.gov>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11972
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Priority|P3 |P1
Last reconfirmed|0000-00-00 00:00:00 |2003-08-18 21:43:48
date| |
Summary|Problems with |[3.4 regression] problem
|allocator::rebind::other |finding nested types in
| |templates
Target Milestone|--- |3.4
------- Additional Comments From bangerth at dealii dot org 2003-08-18 21:43 -------
Confirmed. I guess both the "typename" as well as the "template" in the typedef for
binder_t are unnecessary, but that doesn't change a thing.
Here's something shorter:
-----------------------------------
template <typename T> struct A {
template<typename S> struct B { typedef A<S> X; };
};
template<typename> void f() {
typedef A<int>::B<double>::X X;
}
template void f<int> ();
------------------------------------------------
with present mainline, we get
tmp/g> ../build-gcc/gcc-install/bin/c++ -c x.cc
x.cc: In function `void f()':
x.cc:7: error: expected init-declarator
x.cc:7: error: expected `,' or `;'
If we make the typedef line read
typedef typename A<int>::B<double>::X X;
we get instead
tmp/g> ../build-gcc/gcc-install/bin/c++ -c x.cc
x.cc: In function `void f()':
x.cc:7: error: no type named `X' in `struct A<int>::B<double>'
x.cc:7: error: ISO C++ forbids declaration of `X' with no type
That's certainly not right, and a regression.
W.