public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/22114] New: Incorrect diagnostic for specialization of a nested class template
@ 2005-06-18 14:13 cpp at tempest-sw dot com
2005-06-18 14:13 ` [Bug c++/22114] " cpp at tempest-sw dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: cpp at tempest-sw dot com @ 2005-06-18 14:13 UTC (permalink / raw)
To: gcc-bugs
The code in the attached file is correct (Comeau 4.3.0.1 agrees with me), but
g++ reports an error:
doxybug.cpp:13: error: too few template-parameter-lists
--
Summary: Incorrect diagnostic for specialization of a nested
class template
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: cpp at tempest-sw dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22114
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/22114] Incorrect diagnostic for specialization of a nested class template
2005-06-18 14:13 [Bug c++/22114] New: Incorrect diagnostic for specialization of a nested class template cpp at tempest-sw dot com
@ 2005-06-18 14:13 ` cpp at tempest-sw dot com
2005-06-18 14:47 ` giovannibajo at libero dot it
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: cpp at tempest-sw dot com @ 2005-06-18 14:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cpp at tempest-sw dot com 2005-06-18 14:13 -------
Created an attachment (id=9108)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9108&action=view)
sample code
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22114
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/22114] Incorrect diagnostic for specialization of a nested class template
2005-06-18 14:13 [Bug c++/22114] New: Incorrect diagnostic for specialization of a nested class template cpp at tempest-sw dot com
2005-06-18 14:13 ` [Bug c++/22114] " cpp at tempest-sw dot com
@ 2005-06-18 14:47 ` giovannibajo at libero dot it
2005-06-18 15:20 ` pinskia at gcc dot gnu dot org
2005-07-23 20:59 ` bangerth at dealii dot org
3 siblings, 0 replies; 5+ messages in thread
From: giovannibajo at libero dot it @ 2005-06-18 14:47 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Attachment #9108|text/x-cpp |text/plain
mime type| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22114
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/22114] Incorrect diagnostic for specialization of a nested class template
2005-06-18 14:13 [Bug c++/22114] New: Incorrect diagnostic for specialization of a nested class template cpp at tempest-sw dot com
2005-06-18 14:13 ` [Bug c++/22114] " cpp at tempest-sw dot com
2005-06-18 14:47 ` giovannibajo at libero dot it
@ 2005-06-18 15:20 ` pinskia at gcc dot gnu dot org
2005-07-23 20:59 ` bangerth at dealii dot org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-18 15:20 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |2.95.3 3.0.4 3.3.3 3.4.0
| |4.0.0 4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22114
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/22114] Incorrect diagnostic for specialization of a nested class template
2005-06-18 14:13 [Bug c++/22114] New: Incorrect diagnostic for specialization of a nested class template cpp at tempest-sw dot com
` (2 preceding siblings ...)
2005-06-18 15:20 ` pinskia at gcc dot gnu dot org
@ 2005-07-23 20:59 ` bangerth at dealii dot org
3 siblings, 0 replies; 5+ messages in thread
From: bangerth at dealii dot org @ 2005-07-23 20:59 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2005-07-23 20:56 -------
You can't specialize an inner template without specializing its outer
template as well.
As per /18:
18In an explicit specialization declaration for a member of a class
template or a member template that appears in namespace scope, the
member template and some of its enclosing class templates may remain
unspecialized, except that the declaration shall not explicitly
specialize a class member template if its enclosing class templates
are not explicitly specialized as well. In such explicit
specialization declaration, the keyword template followed by a
template-parameter-list shall be provided instead of the template<>
preceding the explicit specialization declaration of the member. The
types of the template-parameters in the template-parameter-list shall
be the same as those specified in the primary template definition.
[Example:
template<class T1> class A {
template<class T2> class B {
template<class T3> void mf1(T3);
void mf2();
};
};
template<> template<class X>
class A<int>::B { };
template<> template<> template<class T>
void A<int>::B<double>::mf1(T t) { }
template<class Y> template<>
void A<Y>::B<double>::mf2() { } // ill-formed; B<double> is
specialized but
// its enclosing class template A is
not
--end example]
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22114
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-07-23 20:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-18 14:13 [Bug c++/22114] New: Incorrect diagnostic for specialization of a nested class template cpp at tempest-sw dot com
2005-06-18 14:13 ` [Bug c++/22114] " cpp at tempest-sw dot com
2005-06-18 14:47 ` giovannibajo at libero dot it
2005-06-18 15:20 ` pinskia at gcc dot gnu dot org
2005-07-23 20:59 ` bangerth at dealii 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).