This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11858] Name lookup error ignored when instantiated from expression within sizeof() in template function parameter


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11858



------- Additional Comments From bangerth at dealii dot org  2003-08-09 15:52 -------
I'm not where exactly is the bug here: T::x doesn't exist if T=int, so this is a substitution 
failure. This is not an error, the function is simply not available for name lookup. If this 
were the correct interpretation, then we should get an error that there is no suitable 
function T::f in the sizeof expression. But there's a bug anyway. 
 
By the way, this is rejected: 
--------------------------------------------- 
template <int> struct X {}; 
template <typename T> struct S { static typename T::x f (); }; 
template <class T> int f (X<sizeof(T::f())> *); 
int const i = f<S<int> >(0); 
---------------------------------------------- 
 
So it has something to do with the fact that gcc simply ignores the size expression if 
an argument to a function is an array. 
 
W,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]