public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/40828] New: Rejected valid specialization of member class template
@ 2009-07-22 19:03 andhow at gmail dot com
2009-07-23 14:06 ` [Bug c++/40828] " jwakely dot gcc at gmail dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: andhow at gmail dot com @ 2009-07-22 19:03 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]
This is similar to bug 14494. The following member code is rejected:
template <class T>
class Outer {
template <class U> class Inner {};
};
template <class T>
template <>
class Outer<T>::Inner<int> {}; /* error */
with error:
test.cpp:7: error: invalid explicit specialization before â>â token
test.cpp:7: error: enclosing class templates are not explicitly specialized
test.cpp:8: error: template parameters not used in partial specialization:
test.cpp:8: error: âTâ
Of interest, the following partial specialization compiles:
template <class T>
class Outer {
template <class U> class Inner {};
};
template <class T>
template <class U>
class Outer<T>::Inner<U *> {};
--
Summary: Rejected valid specialization of member class template
Product: gcc
Version: 4.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: andhow at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40828
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/40828] Rejected valid specialization of member class template
2009-07-22 19:03 [Bug c++/40828] New: Rejected valid specialization of member class template andhow at gmail dot com
@ 2009-07-23 14:06 ` jwakely dot gcc at gmail dot com
2009-07-23 15:06 ` paolo dot carlini at oracle dot com
2009-07-23 16:31 ` andhow at gmail dot com
2 siblings, 0 replies; 4+ messages in thread
From: jwakely dot gcc at gmail dot com @ 2009-07-23 14:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from jwakely dot gcc at gmail dot com 2009-07-23 14:06 -------
The code is invalid. This is allowed:
template <>
template <class T>
class Outer<int>::Inner<T> {};
but not the other way around. The diagnostic is correct to say "enclosing
class templates are not explicitly specialized"
See the last specialisation in the example following 14.7.3 [temp.expl.spec]
paragraph 18
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40828
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/40828] Rejected valid specialization of member class template
2009-07-22 19:03 [Bug c++/40828] New: Rejected valid specialization of member class template andhow at gmail dot com
2009-07-23 14:06 ` [Bug c++/40828] " jwakely dot gcc at gmail dot com
@ 2009-07-23 15:06 ` paolo dot carlini at oracle dot com
2009-07-23 16:31 ` andhow at gmail dot com
2 siblings, 0 replies; 4+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-07-23 15:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from paolo dot carlini at oracle dot com 2009-07-23 15:06 -------
Thanks Jon.
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40828
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/40828] Rejected valid specialization of member class template
2009-07-22 19:03 [Bug c++/40828] New: Rejected valid specialization of member class template andhow at gmail dot com
2009-07-23 14:06 ` [Bug c++/40828] " jwakely dot gcc at gmail dot com
2009-07-23 15:06 ` paolo dot carlini at oracle dot com
@ 2009-07-23 16:31 ` andhow at gmail dot com
2 siblings, 0 replies; 4+ messages in thread
From: andhow at gmail dot com @ 2009-07-23 16:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from andhow at gmail dot com 2009-07-23 16:31 -------
That is very strange indeed; sorry for the mistake!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40828
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-07-23 16:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-22 19:03 [Bug c++/40828] New: Rejected valid specialization of member class template andhow at gmail dot com
2009-07-23 14:06 ` [Bug c++/40828] " jwakely dot gcc at gmail dot com
2009-07-23 15:06 ` paolo dot carlini at oracle dot com
2009-07-23 16:31 ` andhow at gmail 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).