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++/26573] New: [4.0/4.1/4.2 regression] Duplicate message for static member in local class


The following invalid code snippet

==================================
void foo()
{
  struct A { static int i; };
}
==================================

triggers a duplicate error message since GCC 3.1:

  bug.cc: In function 'void foo()':
  bug.cc:3: error: local class 'struct foo()::A' shall not have static data
member 'int foo()::A::i'
  bug.cc:3: error: field 'foo()::A::i' in local class cannot be static

The first error message was probably added back then because the second
message isn't issued if foo is a template function.


-- 
           Summary: [4.0/4.1/4.2 regression] Duplicate message for static
                    member in local class
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: diagnostic, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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