]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Work around a really ugly bug in Suns Forte compiler, which manifests itself at the...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 22 Mar 2002 18:24:10 +0000 (18:24 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 22 Mar 2002 18:24:10 +0000 (18:24 +0000)
/* ---------------------------------------------------------- */
/* 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...

git-svn-id: https://svn.dealii.org/trunk@5604 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/quadrature.h
deal.II/base/source/quadrature.cc

index efff37f7f541593a247a7423e8d76b9888dc57c8..408591f9e92df8b95e24e97d276267e86f991fd3 100644 (file)
@@ -79,8 +79,43 @@ class Quadrature : public Subscriptor
                                      * object of one dimension
                                      * less. For cells, this would
                                      * then be a face quadrature.
+                                     *
+                                     * Since Sun's Forte compiler has
+                                     * trouble (well, an internal
+                                     * compiler error) if we typedef
+                                     * @p{typedef Quadrature<dim-1>
+                                     * SubQuadrature}, we put this
+                                     * type into a structure. Since
+                                     * again, if the structure is not
+                                     * templatized itself, the
+                                     * compiler barfs, we put a
+                                     * template to it. Now it
+                                     * works. Fortunately you will
+                                     * not usually come into contact
+                                     * with this kludge, but rather
+                                     * use the typedef'd type
+                                     * directly. We beg your pardon
+                                     * for doing such nasty things.
+                                     *
+                                     * For better readability we
+                                     * later typedef this so-created
+                                     * type to one in the enclosing
+                                     * class.
+                                     */
+    template <int dim2>
+    struct SubQuadratureHelper
+    {
+       typedef Quadrature<dim2-1> type;
+    };
+
+                                    /**
+                                     * Typedef the kludge declared
+                                     * above to a type in the class
+                                     * in which we would like to use
+                                     * it.
                                      */
-    typedef Quadrature<dim-1> SubQuadrature;
+    typedef typename SubQuadratureHelper<dim>::type SubQuadrature;
+    
     
                                     /**
                                      * Number of quadrature points.
@@ -98,9 +133,13 @@ class Quadrature : public Subscriptor
                                      * formula in a dimension one
                                      * less than the present and a
                                      * formula in one dimension.
+                                     *
+                                     * @p{SubQuadrature<dim>::type}
+                                     * expands to
+                                     * @p{Quadrature<dim-1>}.
                                      */
     Quadrature (const SubQuadrature &,
-               const Quadrature<1> &);
+               const Quadrature<1>                     &);
     
                                     /**
                                      * Construct a quadrature formula
@@ -295,8 +334,42 @@ class QProjector
                                      * object of one dimension
                                      * less. For cells, this would
                                      * then be a face quadrature.
+                                     *
+                                     * Since Sun's Forte compiler has
+                                     * trouble (well, an internal
+                                     * compiler error) if we typedef
+                                     * @p{typedef Quadrature<dim-1>
+                                     * SubQuadrature}, we put this
+                                     * type into a structure. Since
+                                     * again, if the structure is not
+                                     * templatized itself, the
+                                     * compiler barfs, we put a
+                                     * template to it. Now it
+                                     * works. Fortunately you will
+                                     * not usually come into contact
+                                     * with this kludge, but rather
+                                     * use the typedef'd type
+                                     * directly. We beg your pardon
+                                     * for doing such nasty things.
+                                     *
+                                     * For better readability we
+                                     * later typedef this so-created
+                                     * type to one in the enclosing
+                                     * class.
+                                     */
+    template <int dim>
+    struct SubQuadratureHelper
+    {
+       typedef Quadrature<dim-1> type;
+    };
+
+                                    /**
+                                     * Typedef the kludge declared
+                                     * above to a type in the class
+                                     * in which we would like to use
+                                     * it.
                                      */
-    typedef Quadrature<dim-1> SubQuadrature;    
+    typedef typename SubQuadratureHelper<dim>::type SubQuadrature;
     
                                     /**
                                      * Compute the quadrature points
@@ -306,7 +379,7 @@ class QProjector
                                      * details, see the general doc
                                      * for this class.
                                      */
-    static void project_to_face (const SubQuadrature    &quadrature,
+    static void project_to_face (const SubQuadrature &quadrature,
                                 const unsigned int      face_no,
                                 typename std::vector<Point<dim> > &q_points);
 
index c43175d15c7816d22a437b60ba789f4d2883fb5b..71da6368c94452666060141206debdd649c1fb11 100644 (file)
@@ -97,7 +97,8 @@ Quadrature<1>::Quadrature (const Quadrature<0> &,
 
 template <int dim>
 Quadrature<dim>::Quadrature (const SubQuadrature &q1,
-                            const Quadrature<1> &q2) :
+                            const Quadrature<1>                     &q2)
+               :
                n_quadrature_points (q1.n_quadrature_points *
                                     q2.n_quadrature_points),
                quadrature_points (n_quadrature_points),

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.