https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118116

            Bug ID: 118116
           Summary: FreeFem++-cs compilation error with g++-15
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: shaydin at ktu dot edu.tr
  Target Milestone: ---

When compiling FreeFem++-cs g++-15 gives the following error. However, g++-14
or earlier ones compiles without any error.

g++-15 -DNDEBUG -O2 -I. -I../../fflib/bin_ffcs -D__DIR__='"."' -c -o lgfem.o
lgfem.cpp
lgfem.cpp: In member function ‘AnyType pb2mat<K>::operator()(Stack) const’:
lgfem.cpp:2966:56: error: ‘const class pb2mat<K>’ has no member named ‘stack’
[-Wtemplate-body]
 2966 |     Problem::Data< FESpace > *data = pb->dataptr(this->stack);

The corresponding part of the code is as follows;

template< class K >
class pb2mat : public E_F0 {
 public:
  typedef Matrice_Creuse< K > *Result;
  const Problem *pb;
  pb2mat(const basicAC_F0 &args) : pb(dynamic_cast< const Problem *
> (args[0].left( ))) {
    ffassert(pb);
  }
  static ArrayOfaType typeargs( ) { return ArrayOfaType(atype< const Problem *
>( )); }

  static E_F0 *f(const basicAC_F0 &args) { return new Plot(args); }

  AnyType operator( )(Stack s) const {
    Problem::Data< FESpace > *data = pb->dataptr(this->stack);
    if (SameType< K, double >::OK) {
      ffassert(!!data->AR);
      return SetAny< Matrice_Creuse< K > * >(&data->AR);
    } else {
      ffassert(!!data->AC);
      return SetAny< Matrice_Creuse< K > * >(&data->AC);
    }
  }
};

You can download full code from
https://www.ljll.fr/lehyaric/ffcs/packs/index.html.

Selcuk Han AYDIN

Karadeniz Technical University

Reply via email to