This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
lookup error message
- To: gcc-bugs at gcc dot gnu dot org
- Subject: lookup error message
- From: Dimitri PAPADOPOULOS-ORFANOS <papadopo at shfj dot cea dot fr>
- Date: Wed, 3 Jan 2001 16:21:30 +0100 (MET)
- Reply-To: Dimitri PAPADOPOULOS-ORFANOS <papadopo at shfj dot cea dot fr>
Hi,
This is an improvement request :
* GCC version
gcc version 2.95.2 19991024 (release)
gcc version 2.95.3 20010101 (prerelease)
* system type
i686-pc-linux-gnu
sparc-sun-solaris2.7
* command line that triggers the bug
g++ foo.cc
* compiler output
foo.cc:14: syntax error before `;
* preprocessed file
See attached source file
The source looks like this:
void foo()
{
}
template < typename T >
struct A
{
typedef T foo;
};
template < typename T >
struct B : A< T >
{
foo x;
};
The error message could be made more meaningful. For example
the program below
struct foo
{
};
template < typename T >
struct A
{
typedef T foo;
};
template < typename T >
struct B : A< T >
{
foo x;
};
triggers the following warning:
foo.cc:14: warning: lookup of `foo' finds `struct foo'
foo.cc:14: warning: instead of `typename B<T>::foo' from dependent
base class
foo.cc:14: warning: (use `typename B::foo' if that's what you meant)
By the way, sorry to ask this here, but is the attached code really
invalid or is this a GCC bug? A pointer to a paragraph of the C++
standard anyone?
Dimitri Papadopoulos
void foo()
{
}
template < typename T >
struct A
{
typedef T foo;
};
template < typename T >
struct B : A< T >
{
foo x;
};