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++/12417] Bad error message


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.4


------- Additional Comments From bangerth at dealii dot org  2003-09-26 18:28 -------
Confirmed. Here's a smaller testcase:
-------------------
template <typename> struct A {};

template <typename T>
struct X : A<typename T::Inner> {};

X<int> x;
-------------------

Note that T::Inner doesn't exist for T=int. This is what we get with 3.3:
g/x> /home/bangerth/bin/gcc-3.3.2-pre/bin/c++ -c y.cc
y.cc: In instantiation of `X<int>':
y.cc:7:   instantiated from here
y.cc:7: error: `int' is not a class, struct, or union type

The message is indeed at the point of instantiation, not at the
point where we _use_ T::Inner.

However, with present mainline we get:
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c y.cc
y.cc: In instantiation of `X<int>':
y.cc:6:   instantiated from here
y.cc:4: error: `int' is not a class, struct, or union type

That's much better.

W.


PS: If you haven't found your bug yet: you declare
  template<typename I>
  struct Strided<I, 0> :
    public SubscriptMixin<Strided<I, 0>,
                          typename I::reference>
  {
but then you instantiate this with I=hostText, which is a typedef to char.


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