This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36576] gcc 4.3.1 doesn't build for me on openSUSE 10.3
- From: "karx11erx at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jun 2008 08:57:22 -0000
- Subject: [Bug c++/36576] gcc 4.3.1 doesn't build for me on openSUSE 10.3
- References: <bug-36576-16337@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #14 from karx11erx at hotmail dot com 2008-06-21 08:57 -------
(In reply to comment #13)
> think of:
>
> template<class T> struct CBase<T>
> {
> protected:
> T *i;
> };
> template<> struct CBase<int>
> {
> protected: typedef int i;
> };
>
> template<class T> struct CDerived : public CBase<T>
> {
> inline T* foo (void) { return const_cast <T*> i; }
> }
>
> What happens then?
>
That was not the code, and is not contained anywhere in that code. Your case
seems totally theoretical and constructed, rather like "look what crazy things
could be done with templates!" To be honest, while I have some basic
understanding of templates and healthy applications for them, I don't even
understand "template<> struct CBase<int>" and wonder why one would declare a
type inside of it. But anyway, as the required changes are ISO conformant, our
source code will be changed accordingly (and I won't have to do it, hah).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36576