public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* ice with a big template
@ 2005-07-08 16:17 Vincent Torri
  2005-07-09  0:00 ` Vincent Torri
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Torri @ 2005-07-08 16:17 UTC (permalink / raw)
  To: gcc-help


Hello,

i'm compiling a program with gcc 4.1.0 (not 4.0.1, it's not a mistake ;),
but i've also tried gcc 4.0.0 and there's the ice too), and gcc complains
about that part of the program :

template <typename Functor, typename FunctorMethodPtr>
typename adaptor::adaptor<typename adaptor::caller<Functor, typename
adaptor::decayer<FunctorMethodPtr>::type> >
adapt(Functor const& functor, FunctorMethodPtr)
{
  return typename adaptor::adaptor<typename adaptor::caller<Functor,
typename adaptor::decayer<FunctorMethodPtr>::type> >(functor);
}

The error reported by gcc is:

../../src/functions/../parser/adapt.h: In function
'avs::parser::adaptor::adaptor<avs::parser::adaptor::caller<Functor,
typename avs::parser::adaptor::decayer<FunctorMethodPtr>::type>, typename
avs::parser::adaptor::caller<Functor, typename
avs::parser::adaptor::decayer<FunctorMethodPtr>::type>::ResultType>
avs::parser::detail::adapt(const Functor&, FunctorMethodPtr)':
../../src/functions/../parser/adapt.h:50: internal compiler error: tree
check: expected class 'type', have 'declaration' (namespace_decl) in
dependent_type_p, at cp/pt.c:12020

line 50 is the line where the 'return' is.

I'm not skilled enough to know if it's a problem with gcc or with the
program.

I would also like to point out that there is no problem with gcc 3.3.4.

Does someone see any problem in the code above, or a workaround ?

Thank you

Vincent Torri

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ice with a big template
  2005-07-08 16:17 ice with a big template Vincent Torri
@ 2005-07-09  0:00 ` Vincent Torri
  0 siblings, 0 replies; 2+ messages in thread
From: Vincent Torri @ 2005-07-09  0:00 UTC (permalink / raw)
  To: gcc-help


Hello again,

With :

  typedef typename adaptor::adaptor<typename adaptor::caller<Functor,
typename adaptor::decayer<FunctorMethodPtr>::type> > my_type;
  return my_type(functor);

there is no compilation problem.

maybe there is a gcc bug.

Vincent Torri

On Fri, 8 Jul 2005, Vincent Torri wrote:

>
> Hello,
>
> i'm compiling a program with gcc 4.1.0 (not 4.0.1, it's not a mistake ;),
> but i've also tried gcc 4.0.0 and there's the ice too), and gcc complains
> about that part of the program :
>
> template <typename Functor, typename FunctorMethodPtr>
> typename adaptor::adaptor<typename adaptor::caller<Functor, typename
> adaptor::decayer<FunctorMethodPtr>::type> >
> adapt(Functor const& functor, FunctorMethodPtr)
> {
>   return typename adaptor::adaptor<typename adaptor::caller<Functor,
> typename adaptor::decayer<FunctorMethodPtr>::type> >(functor);
> }
>
> The error reported by gcc is:
>
> ../../src/functions/../parser/adapt.h: In function
> 'avs::parser::adaptor::adaptor<avs::parser::adaptor::caller<Functor,
> typename avs::parser::adaptor::decayer<FunctorMethodPtr>::type>, typename
> avs::parser::adaptor::caller<Functor, typename
> avs::parser::adaptor::decayer<FunctorMethodPtr>::type>::ResultType>
> avs::parser::detail::adapt(const Functor&, FunctorMethodPtr)':
> ../../src/functions/../parser/adapt.h:50: internal compiler error: tree
> check: expected class 'type', have 'declaration' (namespace_decl) in
> dependent_type_p, at cp/pt.c:12020
>
> line 50 is the line where the 'return' is.
>
> I'm not skilled enough to know if it's a problem with gcc or with the
> program.
>
> I would also like to point out that there is no problem with gcc 3.3.4.
>
> Does someone see any problem in the code above, or a workaround ?
>
> Thank you
>
> Vincent Torri
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-07-09  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-08 16:17 ice with a big template Vincent Torri
2005-07-09  0:00 ` Vincent Torri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).