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]

[Bug c++/13639] New: enum member is not allowed to have same name as the namespace it is contained in


An enum member is not allowed to have same name as the namespace it is 
contained in. 
 
The code 
 
namespace a { 
    enum { a }; 
}; 
 
is rejected with: 
 
bug.cc:2: error: `a' redeclared as different kind of symbol 
bug.cc:1: error: previous declaration of `a' 
 
As far as I understand the C++ standard this is perfectly allowed.

-- 
           Summary: enum member is not allowed to have same name as the
                    namespace it is contained in
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rschiele at uni-mannheim dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i586-suse-linux
  GCC host triplet: i586-suse-linux
GCC target triplet: i586-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13639


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