This is the mail archive of the gcc@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]

Re: Another new-parser problem? (libstdc++)


On Fri, 17 Jan 2003, Mark Mitchell wrote:

> --On Friday, January 17, 2003 05:15:37 PM +0100 Richard Guenther
> <rguenth@tat.physik.uni-tuebingen.de> wrote:
>
> > Ok, a "simple" testcase is attached (unincluded output from -save-temps
> > .ii file, line-numbers and blank lines removed, etc.). To reproduce
> > simply do
>
> This file still has #include's in it; would you please send me the .ii
> file you get from "g++ -save-temps -c ..."?

I simplified the testcase (.ii.gz attached) and re-checked with g++ (GCC)
3.4 20030121 (experimental):

The funy thing is, once I change the notify() invocation to

    Observable<T*>::notify((int)notifyUncompress);

the testcase works. Wasnt an enum convertible to int? And why does it fail
in std::vector if it isnt? Seems to be some lookup problem.

Thanks, Richard.

Btw. reducing the testcase I stombled on PR c++/9384 which is an ICE
on illegal code (selected ICE on legal code errornously - perhaps someone
could change that).


#include <vector>
template <class T>
struct Observer {};
template<class T>
struct Observable
{
  void notify(int event);
  std::vector<Observer<T> *> observers_m;
};
template <class T>
struct CompressibleBlock
{
  enum Notifier { notifyUncompress = 1 };
  void uncompressUnlocked()
  {
     Observable<T*>::notify(notifyUncompress);
  }
};

~/ix86/gcc3.4/bin/g++ -c
~/src/pooma-bugfixes/r2/src/Engine/CompressibleBlock.ii.h -save-temps
/home/rguenth/ix86/gcc3.4/include/c++/3.4/bits/stl_vector.h: In
instantiation of `std::_Vector_alloc_base<Observer<T*>*,
std::allocator<Observer<T*>*>, std::_Alloc_traits<Observer<T*>*,
std::allocator<Observer<T*>*> >::_S_instanceless>':
/home/rguenth/src/pooma-bugfixes/r2/src/Engine/CompressibleBlock.ii.h:8:
instantiated from `std::_Vector_base<Observer<T*>*,
std::allocator<Observer<T*>*> >'
/home/rguenth/src/pooma-bugfixes/r2/src/Engine/CompressibleBlock.ii.h:8:
instantiated from `std::vector<Observer<T*>*,
std::allocator<Observer<T*>*> >'
/home/rguenth/src/pooma-bugfixes/r2/src/Engine/CompressibleBlock.ii.h:8:
instantiated from `Observable<T*>'
/home/rguenth/src/pooma-bugfixes/r2/src/Engine/CompressibleBlock.ii.h:16:
instantiated from here
/home/rguenth/ix86/gcc3.4/include/c++/3.4/bits/stl_vector.h:91: error: `
   std::_Vector_alloc_base<_Tp, _Allocator, _IsStatic>::_M_data_allocator'
has
   incomplete type
/home/rguenth/ix86/gcc3.4/include/c++/3.4/bits/stl_vector.h:91: confused
by earlier errors, bailing out



--
Richard Guenther <richard.guenther@uni-tuebingen.de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/

Attachment: CompressibleBlock.ii.ii.gz
Description: testcase


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