public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13613] New: enumerator conflict from enclosing namespace
@ 2004-01-08 14:49 mdorey at bluearc dot com
  2004-01-08 15:52 ` [Bug c++/13613] " falk at debian dot org
  0 siblings, 1 reply; 2+ messages in thread
From: mdorey at bluearc dot com @ 2004-01-08 14:49 UTC (permalink / raw)
  To: gcc-bugs

enum A {
  B
};
namespace C {
  enum D {
    B
  };
}

Now produces:

enumerator-namespace-3.3.3-regression.cpp:7: error: conflicting types for `B'
enumerator-namespace-3.3.3-regression.cpp:3: error: previous declaration as `A 
   B'

When I think it should compile as do at least some previous gcc versions.

The above error was from:

gcc -v -c enumerator-namespace-3.3.3-regression.cpp 
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.3/specs
Configured with: ../src/configure -v --enable-
languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --
mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-
dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --
without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-
debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.3 20031229 (prerelease) (Debian)
 /usr/lib/gcc-lib/i486-linux/3.3.3/cc1plus -quiet -v -D__GNUC__=3 -
D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D_GNU_SOURCE enumerator-namespace-
3.3.3-regression.cpp -D__GNUG__=3 -quiet -dumpbase enumerator-namespace-3.3.3-
regression.cpp -auxbase enumerator-namespace-3.3.3-regression -version -
o /tmp/ccciZdLn.s
GNU C++ version 3.3.3 20031229 (prerelease) (Debian) (i486-linux)
        compiled by GNU C version 3.3.3 20031229 (prerelease) (Debian).
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=129171
ignoring nonexistent directory "/usr/i486-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3
 /usr/include/c++/3.3/i486-linux
 /usr/include/c++/3.3/backward
 /usr/local/include
 /usr/lib/gcc-lib/i486-linux/3.3.3/include
 /usr/include
End of search list.

And I know it compiles OK on:

gcc -v -c enumerator-namespace-3.3.3-regression.cpp 
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.2/specs
Configured with: ../src/configure -v --enable-
languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --
mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-
dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --
without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-
debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.2 20030831 (Debian prerelease)
 /usr/lib/gcc-lib/i486-linux/3.3.2/cc1plus -quiet -v -D__GNUC__=3 -
D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=2 -D_GNU_SOURCE enumerator-namespace-
3.3.3-regression.cpp -D__GNUG__=3 -quiet -dumpbase enumerator-namespace-3.3.3-
regression.cpp -auxbase enumerator-namespace-3.3.3-regression -version -
o /tmp/ccv9ZMlX.s
GNU C++ version 3.3.2 20030831 (Debian prerelease) (i486-linux)
        compiled by GNU C version 3.3.2 20030831 (Debian prerelease).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/i486-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3
 /usr/include/c++/3.3/i486-linux
 /usr/include/c++/3.3/backward
 /usr/local/include
 /usr/lib/gcc-lib/i486-linux/3.3.2/include
 /usr/include
End of search list.
 as -V -Qy -o enumerator-namespace-3.3.3-regression.o /tmp/ccv9ZMlX.s
GNU assembler version 2.14.90.0.7 (i386-linux) using BFD version 2.14.90.0.7 
20031029 Debian GNU/Linux

So I'm thinking that this is a regression in 3.3.3 over 3.3.2.

Perhaps one relevant sentence from the Standard is from 7.2.10: The enum-name 
and each enumerator declared by an enum-specifier is declared in the scope that 
immediately contains the enum-specifier.

-- 
           Summary: enumerator conflict from enclosing namespace
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mdorey at bluearc dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/13613] enumerator conflict from enclosing namespace
  2004-01-08 14:49 [Bug c++/13613] New: enumerator conflict from enclosing namespace mdorey at bluearc dot com
@ 2004-01-08 15:52 ` falk at debian dot org
  0 siblings, 0 replies; 2+ messages in thread
From: falk at debian dot org @ 2004-01-08 15:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From falk at debian dot org  2004-01-08 15:52 -------
Known regression


*** This bug has been marked as a duplicate of 13544 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-01-08 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-08 14:49 [Bug c++/13613] New: enumerator conflict from enclosing namespace mdorey at bluearc dot com
2004-01-08 15:52 ` [Bug c++/13613] " falk at debian dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).