On Aug 10, 2005, at 8:54 AM, Jack Howarth wrote:

FX,
    I forgot to mention that since the gcc cvs I built last night now
contains your ISATTY and TTYNAM intrinsics patch, I regressed the
portion of the xplor.patch which worked around the prior absence
of the ISATTY intrinsic in gfortran. The resulting xplor-nih build
works fine.
    One other question. Do you know much c++? I had to make one change
to some buggy c++ code to allow gcc 4.0 and main branch to compile
xplor-nih...


I am trying to figure out if this is catching some new buggy c++ which
is no longer accepted by the g++ compiler in gcc 4.1 or if this is a
regression in that branch.

The code is invalid C++ as "friend class" does not define a forward
declaration.  Also for 4.1, the function norm is not considered as it
is declared after the use as 4.1

Both are invalid C++.
The example for the second issue is:

template<class T> class FixedVector;
template<class T> void  norm(const FixedVector<T>& v);
template <class T> T g(void);
template<class T> void f(void) { norm(g<T>()); }
double norm(const double& v) {}
static void _wrap_sqrt__SWIGPY_1(){f<int >();}

there is only one norm before f, so the overloaded set of norm in the template f is just that one norm. If you move the other norm before the f, it works as expected in
both GCC 4.1.0 and ICC in strict mode.

Thanks,
Andrew Pinski

Reply via email to