#include <cstdlib>
],
[
-unsigned int seed = 0;
+int seed = 0;
int i=rand_r(&i);
],
[
dnl /* ----------------------------------------------- */
dnl /* Problem 14: Access control. Friendship is not */
dnl /* granted although explicitly declared. */
-dnl template <int N, int M> class T { void bar (); };
+dnl template <int N, int M> class T { int bar (); };
dnl
dnl template <int M> class T<1,M> {
dnl private:
dnl template <int N1, int N2> friend class T;
dnl };
dnl
-dnl template <int N,int M> void T<N,M>::bar () {
-dnl T<N-1,M>::i;
+dnl template <int N,int M> int T<N,M>::bar () {
+dnl return T<N-1,M>::i;
dnl };
dnl
dnl template class T<2,1> ;
CXXFLAGS="$CXXFLAGSG"
AC_TRY_COMPILE(
[
- template <int N, int M> class T { void bar (); };
+ template <int N, int M> struct T { int bar (); };
- template <int M> class T<1,M> {
+ template <int M> struct T<1,M> {
+ T ();
private:
static int i;
template <int N1, int N2> friend class T;
};
- template <int N,int M> void T<N,M>::bar () {
- T<N-1,M>::i;
+ template <int N,int M> int T<N,M>::bar () {
+ return T<N-1,M>::i;
};
template class T<2,1> ;
dnl struct X
dnl {
dnl template <typename T2>
-dnl X operator = (T2 &){};
+dnl X operator = (T2 &) { return X(); };
dnl };
dnl
dnl template X X::operator=<float> (float &);
struct X
{
template <typename T2>
- X operator = (T2 &){};
+ X operator = (T2 &) { return X(); };
};
template X X::operator=<float> (float &);
};
template <typename T> class X<1,T> {
- X () { Y<T>::i; }; // access private field
+ int f () { return Y<T>::i; }; // access private field
};
template class X<1,int>;
};
template <template <int> class T>
- void X<T>::foo (type t) {};
+ void X<T>::foo (type) {};
template struct X<TT>;
],
void f()
{
- long double *p1, *p2;
- double *p3;
+ long double *p1=0, *p2=0;
+ double *p3=0;
copy (p1, p2, p3);
p3 = copy (p1, p2, p3);
};
void f(T<dim>);
template <int dim, template <int> class T>
- void g()
+ void* g()
{
void (*p) (T<dim>) = &f<dim,T>;
+ return (void*)p;
}
template void g<2,X> ();
#include <limits>
],
[
- unsigned int i = std::numeric_limits<unsigned int>::min();
+ return std::numeric_limits<unsigned int>::min();
],
[
AC_MSG_RESULT(yes)