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]

explicit scope operator masks reportable error


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
}


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