Article View: gnu.gcc.bug
Article #6110scope bug for a type defined within a class
From: Victor Lobanov
Date: Mon, 02 Dec 1996 00:00
Date: Mon, 02 Dec 1996 00:00
31 lines
1054 bytes
1054 bytes
Hi!
I believe I've encontered a bug using gcc version 2.7.2.1 on Linux 2.0.18
Attemps to compile the following program:
class Bar {
public:
typedef int Type;
};
template<class T> class Foo {
public:
typedef T::Type fooType;
void dump(fooType x);
void dump2(fooType x) { cout << x; }
};
template<class T> void Foo<T>::dump(fooType x) { cout << x; }
int main()
{
Foo<Bar> foo;
foo.dump(1);
return 0;
}
produce an error "`fooType' was not declared in this scope" for the
function dump but not for the function dump2.
Sincerely,
Technical Details
Message-ID:
<199612022002.PAA07586@ycnex.3dp.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113d02,c5519e688cf08194,start X-Google-Attributes: gid113d02,public From: victor@ycnex.3dp.com (Victor Lobanov) Subject: scope bug for a type defined within a class Date: 1996/12/02 Message-ID: <199612022002.PAA07586@ycnex.3dp.com> X-Deja-AN: 201951830 sender: bug-gcc-request@prep.ai.mit.edu x-gateway: relay2.UU.NET from bug-gcc to gnu.gcc.bug; Mon, 2 Dec 1996 14:58:31 EST newsgroups: gnu.gcc.bug