This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/43648] New: [4.5 regression] ICE with explicit destructor call and typedef


With mainline from 20100107, the following code fails on Mac OS X:
----------------------------------
namespace dealii
{
  namespace FEValuesViews
  {
    template <int dim, int spacedim> struct Scalar {};
  }

  template <int dim, int spacedim>
  struct X
  {
      FEValuesViews::Scalar<dim,spacedim> scalars[dim*spacedim];

      void f()
        {
          typedef dealii::FEValuesViews::Scalar<dim,spacedim> ScalarView;
          scalars[0].ScalarView::~ScalarView ();
        }
  };

  template struct X<2,2>;
}
-----------------------------

>From what I can gather from the person who told me this, the error message
looks along the lines (line numbers/function names/file names are wrong,
though):

source/fe/fe_values.cc: In constructor
&#8216;dealii::internal::FEValuesViews::Cache<dim, spacedim>::Cache(const
dealii::FEValuesBase<dim, spacedim>&) [with int dim = 1, int spacedim =
1]&#8217;:
source/fe/fe_values.cc:1486:31:   instantiated from
&#8216;dealii::FEValuesBase<dim, spacedim>::FEValuesBase(unsigned int, unsigned
int, dealii::UpdateFlags, const dealii::Mapping<dim, spacedim>&, const
dealii::FiniteElement<dim, spacedim>&) [with int dim = 1, int spacedim =
1]&#8217;
source/fe/fe_values.cc:3941:16:   instantiated from here
source/fe/fe_values.cc:1057:4: error: no type named &#8216;ScalarView&#8217; in
&#8216;class dealii::FEValuesViews::Scalar<1>&#8217;
source/fe/fe_values.cc:1057:4: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.

The problem is that the code was written with the typedef, rather than
explicitly spelling out the full qualified class name, since some other
compilers do not grok it any other way.

Best
 W.


-- 
           Summary: [4.5 regression] ICE with explicit destructor call and
                    typedef
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43648


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]