This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
explicit scope operator masks reportable error
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 17 Jan 2003 02:20:54 -0600 (CST)
- Subject: explicit scope operator masks reportable error
- Reply-to: rittle at labs dot mot dot com
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
}