explicit scope operator masks reportable error
Loren James Rittle
rittle@latour.rsch.comm.mot.com
Fri Jan 17 08:38:00 GMT 2003
To whom it may concern: While looking at Mark's patch to
disallow/tighten-WRT-the-spec unqualified lookup in template context
(at the library/user-level only), I noticed that the new parser or
some other recent mainline patch appears to have introduced a trivial
accepts-illegal bug. It appears to pre-exist the tightening patch.
// { dg-do compile }
// Copyright (C) 2003 Free Software Foundation, Inc.
template <typename T>
struct B { void f() { ::i = 5; } }; // { dg-error "has not been declared" "" }
// under my reading of the spec, the above error may be diagnosed without:
void bar()
{
B<int> b;
b.f(); // however, the old parser required this line to diagnose any error
}
More information about the Gcc-bugs
mailing list