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]

c++/6734: Overly permissive name lookup



>Number:         6734
>Category:       c++
>Synopsis:       Overly permissive name lookup
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 20 05:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     ericcrampton@hotmail.com
>Release:        gcc-3.1 and gcc-3.0.4
>Organization:
>Environment:
Redhat Linux 7.2 (Intel), verified on gcc-3.1 and gcc-3.0.4
>Description:
The code below compiles, but it should not. The compiler is allowing a class and namespace to have the same name, but it should not.

FWIW, Comeau's compiler rejects this code.

namespace Foo
{
}

class Foo
{
};

int main()
{
}
>How-To-Repeat:
Compile the code in the description.
>Fix:
Output an error.
>Release-Note:
>Audit-Trail:
>Unformatted:


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