| View previous topic :: View next topic |
| Author |
Message |
Andrew N. Maximov Guest
|
Posted: Sat Jun 18, 2005 9:25 am Post subject: using declaration for class member template |
|
|
Hello, All!
I have a little problem with using declaration...
struct A
{
template <class T>
void foo(T a) { }
};
struct B : private A
{
using A::foo;
};
int main()
{
B b;
b.foo(5);
return 0;
}
[email]dron@hal:~/gcc.bugs[/email]$ g++ templ.using.cxx -c -o templ.using.o
templ.using.cxx: In function `int main()':
templ.using.cxx:4: error: `void A::foo(T) [with T = int]' is inaccessible
templ.using.cxx:15: error: within this context
[email]dron@hal:~/gcc.bugs[/email]$ g++ --version
g++ (GCC) 3.3.3
This is gcc bug, or not?
With best regards, Andrew N. Maximov.
Radius Ltd, +7 0843943236 ICQ:101436920
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Sumit Rajan Guest
|
Posted: Sun Jun 19, 2005 11:58 am Post subject: Re: using declaration for class member template |
|
|
"Andrew N. Maximov" <MXLUKKPSKWMU (AT) spammotel (DOT) com> wrote
| Quote: | Hello, All!
I have a little problem with using declaration...
struct A
{
template <class T
void foo(T a) { }
};
struct B : private A
{
using A::foo;
};
int main()
{
B b;
b.foo(5);
return 0;
}
|
I do not see why this should not compile. It seems to compile successfully
using Comeau and with VC++ 7.1.
--
Sumit Rajan
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
mlimber Guest
|
Posted: Tue Jun 21, 2005 6:33 pm Post subject: Re: using declaration for class member template |
|
|
Sumit Rajan wrote:
| Quote: | I do not see why this should not compile. It seems to compile successfully
using Comeau and with VC++ 7.1.
|
And with VC++ 6 and g++ 3.4.1.
M
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Chris Hoge Guest
|
Posted: Tue Jun 21, 2005 6:35 pm Post subject: Re: using declaration for class member template |
|
|
Curious. Using g++ 3.3 and 3.1 it fails, but with g++ 4.0 it compiles.
So it's likely a gcc bug that's been fixed with the latest compiler.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
|