[Bug c++/12672] Evals template defaults args that it should not

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Oct 18 16:19:00 GMT 2003


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

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



------- Additional Comments From pinskia at gcc dot gnu dot org  2003-10-18 15:46 -------
Here is the example without an extra includes, I have not looked to see what the standard says 
abou this though:
template<typename i> class it
{
        typedef typename i::iterator_category iterator_category;
};

template<typename U>
class UT { public: U u;};

template<typename U,
                        typename C = typename it<U>::iterator_category>
class Aux {
public:
        typedef UT<U> R;
        };


template<typename T> class R { public: T t;};

template<typename T>
typename Aux<T>::R Foo(T t) { return 0; }

template<typename T>
void Foo(T, T);

void Foo(int, int) { }

template<typename T>
T Bar(T, T);

inline int Bar(int i1, int i2) { return i1; }
inline char Bar(char c1, char c2) { return c1; }

int main() {
        Bar(0, 1);
        Bar<char>(0, 1);
        Bar<int>(0, 1);
        Foo(1, 2);
        Foo<int>(1, 2);
        }



More information about the Gcc-bugs mailing list