From: wolf Date: Mon, 25 Mar 2002 16:13:44 +0000 (+0000) Subject: Work around the following bug in Sun's Forte compiler, by simply X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a6559a1cc65ce5d878a151446cbe0bd113e6428;p=dealii-svn.git 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 class V {}; struct B1 { template struct X { int i[dim]; }; }; struct B2 : private B1 {}; struct D : public B2, private B1 { ~D () {}; typedef B1::X<2> X; V x; }; D d; git-svn-id: https://svn.dealii.org/trunk@5618 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/matrix_out.h b/deal.II/lac/include/lac/matrix_out.h index ea4011757b..546ae2f3d5 100644 --- a/deal.II/lac/include/lac/matrix_out.h +++ b/deal.II/lac/include/lac/matrix_out.h @@ -54,9 +54,39 @@ * the documentation of the members of the @ref{Options} class for a * description of these flags. * + * + * @sect3{Internals} + * + * To avoid a compiler error in Sun's Forte compiler, we derive + * privately from @ref{DataOutBase}. Since the base class + * @ref{DataOutInterface} does so as well, this does no harm, but + * calms the compiler which is suspecting an access control conflict + * otherwise. Testcase here: + * @begin{verbatim} + * template class V {}; + * + * struct B1 { + * template struct X { + * int i[dim]; + * }; + * }; + * + * struct B2 : private B1 {}; + * + * struct D : public B2, private B1 { + * ~D () {}; + * typedef B1::X<2> X; + * V x; + * }; + * + * D d; + * @end{verbatim} + * + * * @author Wolfgang Bangerth, 2001 */ -class MatrixOut : public DataOutInterface<2,2> +class MatrixOut : public DataOutInterface<2,2>, + private DataOutBase { public: /**