wolf [Thu, 11 Apr 2002 14:25:14 +0000 (14:25 +0000)]
Detect and work around a bug in gcc2.95 which requires that we use some non-ISO C++. While we are at it, require autoconf2.50 or higher, which is what we implicitly required before already.
wolf [Mon, 25 Mar 2002 16:13:44 +0000 (16:13 +0000)]
Work around the following bug in Sun's Forte compiler, by simply
adding a private inheritance of B1. Since that base class only has
static members, that does not hurt anyway.
/* ------------------------------------------------- */
/* Problem 17 -- access control: compiler error */
/* Error: B1::dim is not accessible from B1::X<2>. */
/* Where: While specializing "B1::X<2>" */
/* Where: Specialized in non-template code. */
/* Note that "dim" should actually be placed with */
/* B1::X, rather than with B1. */
template <typename T> class V {};
struct B1 {
template <int dim> struct X {
int i[dim];
};
};
struct B2 : private B1 {};
struct D : public B2, private B1 {
~D () {};
typedef B1::X<2> X;
V<X> x;
};
wolf [Mon, 25 Mar 2002 15:20:09 +0000 (15:20 +0000)]
Work around a bug in Sun's Forte compiler. The code in question was
dangerous anyway, and since this is no performance critical place, we
take the plunge.
wolf [Mon, 25 Mar 2002 15:09:29 +0000 (15:09 +0000)]
Detect and work around the following bug in pre-3.0 gccs:
struct X
{
template <typename T2>
X operator = (T2 &) {return *this;};
};
template X X::operator=<> (float &);
These compilers reported
x.cc:7: 'operator =' not defined
x.cc:7: confused by earlier errors, bailing out
and wanted that we write
template X X::template operator=<> (float &);
instead. This is not what the standard prescribes, and is also not necessary for regular member functions.
Unfortunately, we cannot simply add that 'template' here, since otherwise Sun's Forte compiler no more
groks this. So we define a symbol DEAL_II_MEMBER_OP_TEMPLATE_INST which is empty for standards
compliant compilers, or 'template' in case of broken gcc's.
wolf [Mon, 25 Mar 2002 14:04:29 +0000 (14:04 +0000)]
Detect and work around the following bug:
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
dnl template <int M> class T<1,M> {
dnl private:
dnl static int i;
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 };
dnl
dnl template class T<2,1> ;
We work around by making a certain function in the Tensor<1,dim> class public.
wolf [Fri, 22 Mar 2002 18:24:10 +0000 (18:24 +0000)]
Work around a really ugly bug in Suns Forte compiler, which manifests itself at the following testcase:
/* ---------------------------------------------------------- */
/* Internal compiler error in abi2_mangler::entity_expression */
/* when compiled with -g. */
template < int dim > struct T {
typedef T<dim-1> SubT;
T (SubT);
};
template <int dim> T<dim>::T (SubT) {};
template class T<3> ;
If compiled with -g, the compiler gets an internal compiler error...
wolf [Fri, 22 Mar 2002 17:34:02 +0000 (17:34 +0000)]
When we forward declare the general Tensor template, also declare that it has a partial specialization. Otherwise, Sun Forte is confused, but I believe rightfully so. Unfortunately, its error messages are less than helpful in this case...
wolf [Wed, 20 Mar 2002 12:49:59 +0000 (12:49 +0000)]
Work around a problem of Suns Forte compiler which cant handle the case that an enum or a class in a namespace has the same name as the namespace itself, as in
/* ----------------------------------------------- */
/* Problem 10 -- Members with the same name as the */
/* enclosing namespace. */
namespace NS3 {
class NS3 {};
};
NS3::NS3 ns3;
Thus rename the IteratorState enum in the IteratorState namespace into IteratorState_s_.
wolf [Wed, 20 Mar 2002 12:46:21 +0000 (12:46 +0000)]
Work around a problem of Suns Forte compiler which cant handle the case that an enum or a class in a namespace has the same name as the namespace itself, as in
/* ----------------------------------------------- */
/* Problem 10 -- Members with the same name as the */
/* enclosing namespace. */
namespace NS3 {
class NS3 {};
};
NS3::NS3 ns3;
Thus rename the IteratorState enum in the IteratorState namespace into IteratorState_s_.
wolf [Wed, 20 Mar 2002 12:43:38 +0000 (12:43 +0000)]
Work around a problem in Suns Forte compiler, which choked on the explicit qualification of a member template when that member template is an operator, as in
/* --------------------------------------- */
/* Problem 9 -- selecting member templates */
/* by template keyword */
/* (Why does it make a difference whether */
/* member function or operator?) */
class T7 {
template <typename T> void operator << (T);
template <typename T> void f (T);
void g() {
this->template f<int> (1); // OK!
this->template operator<< <int> (1); // not!
};
};
Work around by introducing a common function for the template and the nontemplate function.
wolf [Wed, 20 Mar 2002 12:40:54 +0000 (12:40 +0000)]
Work around a problem of the Sun Forte compiler that chokes on some trailing semicolons, like in
/* ---------------------------------------- */
/* Problem 1 -- extraneous semicolon? */
/* (Why does this go away if not a template */
/* or in a namespace?) */
namespace NS1 {
template <class T>
void test () {};
};
/* ---------------------------------------- */
/* Problem 2 -- extraneous semicolon? */
/* (Why for inner but not outer namespace?) */
namespace NS2 {
namespace NS3 {};
};
wolf [Wed, 20 Mar 2002 12:39:42 +0000 (12:39 +0000)]
Suns Forte compiler chokes on template argument computations, like in
/* ----------------------------------------------- */
/* Problem 5 -- no computations with template args */
template <int dim> struct T2 {};
template <int dim> T2<dim-1> g(T2<dim>) {};
Fix this by introducing a new type local to the class that uses it.
wolf [Mon, 18 Mar 2002 13:09:02 +0000 (13:09 +0000)]
Remove semicolons to work around a bug in Sun Forte. Testcase:
/* ---------------------------------- */
/* Problem 1 -- extraneous semicolon? */
namespace NS1 {
template <class T>
void test () {};
};
Avoid friend declaration of typedefs. Testcase:
/* -------------------------------- */
/* Problem 6 -- friend and typedefs */
class T3;
class T4
{
typedef T3 Tloc;
friend class Tloc;
};
wolf [Mon, 18 Mar 2002 12:26:38 +0000 (12:26 +0000)]
Move implementations to .cc file, since not used very often anyway and
thus no point to mark inline. change triggered by Sun Forte 6.2's
inability to first declare a function, then define it marked
inline. testcase:
wolf [Fri, 8 Mar 2002 09:10:03 +0000 (09:10 +0000)]
Significantly change the way configure works. Mostly, configure.in is now only a list of task to be done, cleanly separated into several categories. The actual work is done by macros in aclocal.m4. Also, config.guess and alike have been banned from the top-level directory and are now in contrib/config.