+++ This bug was initially created as a clone of Bug #7869 +++

I stumbled over the second issue that the original bug report mentioned. I
think it was closed prematurely.
To clarify this a bit I provide my own short example.
It may be worth noting that comeau online does not produce any errors on this
code, nor does microsofts c++ compiler that comes with visual studio 8.

struct tag{};

struct A {
  tag  t;  // *
  typedef int tag;
};

*omit this declaration and everything is fine for g++

error msg on g++3.4.4:

error: declaration of `typedef int A::tag'
error: changes meaning of `tag' from `struct tag'

Why would the outer tag declaration conflict with the tag declaration in scope
A? This is not an error that I would have expected intuitively which is why I'd
like to bring this up again.


-- 
           Summary: faults typedef redefinition in struct
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: baraclese at hotmail dot com


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

Reply via email to