Bug 13544 - [3.3.3 regression] "conflicting types" for enums in different scopes
Summary: [3.3.3 regression] "conflicting types" for enums in different scopes
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3.3
: P1 critical
Target Milestone: 3.3.3
Assignee: Gabriel Dos Reis
URL:
Keywords: rejects-valid
: 13546 13613 13639 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-01-02 11:23 UTC by Debian GCC Maintainers
Modified: 2004-01-11 13:04 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-01-02 13:42:51


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Debian GCC Maintainers 2004-01-02 11:23:09 UTC
[forwarded from http://bugs.debian.org/225663]

this regression was introduced between 20031206 and 20031229 on the 3.3 branch.

the following example

enum Enum1
{
    None
};

namespace Test
{
    enum Enum2
    {
        None
    };
}

int main()
{
}
 
compiles withtest.cpp:11: error: conflicting types for `None'
test.cpp:4: error: previous declaration as `Enum1 None'
Comment 1 Andrew Pinski 2004-01-02 13:28:01 UTC
*** Bug 13546 has been marked as a duplicate of this bug. ***
Comment 2 Andrew Pinski 2004-01-02 13:42:51 UTC
Confirmed.
Comment 3 Andrew Pinski 2004-01-02 15:12:01 UTC
Reverting this patch:
2003-12-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>

        Backport from mainline:
        2003-12-22  Mark Mitchell  <mark@codesourcery.com>

        PR C++/12862
        * decl.c (pushdecl): Look up all namespace-scope entities in their
        corresponding namespace.

Fixes the problem.
Comment 4 Falk Hueffner 2004-01-08 15:52:27 UTC
*** Bug 13613 has been marked as a duplicate of this bug. ***
Comment 5 Nathanael C. Nerode 2004-01-08 21:44:53 UTC
This is biting Debian rather badly.  Can this possibly be fixed quickly?  :-/
Comment 6 Gabriel Dos Reis 2004-01-09 04:27:59 UTC
Subject: Re:  [3.3.3 regression] "conflicting types" for enums in different scopes

"neroden at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| This is biting Debian rather badly.  Can this possibly be fixed quickly?  :-/

Someone had the bright idea to steal my laptop in my office this
afternoon, 1-2 days delay may be expected.
Comment 7 Robert Schiele 2004-01-10 16:57:19 UTC
*** Bug 13639 has been marked as a duplicate of this bug. ***
Comment 8 Gabriel Dos Reis 2004-01-10 17:33:32 UTC
Mine
Comment 9 CVS Commits 2004-01-11 00:56:05 UTC
Subject: Bug 13544

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	gdr@gcc.gnu.org	2004-01-11 00:56:02

Modified files:
	gcc/cp         : ChangeLog decl.c 
Added files:
	gcc/testsuite/g++.dg/lookup: enum1.C 

Log message:
	PR c++/13544
	* decl.c (build_enumerator): Set DECL_CONTEXT after the
	enumerator
	has been pushed.
	(pushdecl): Don't use DECL_NAMESPACE_SCOPE_P to test whether a
	decl has a namespace-scope; that isn't really what it means.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.235&r2=1.3076.2.236
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.965.2.70&r2=1.965.2.71
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/enum1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1

Comment 10 Gabriel Dos Reis 2004-01-11 00:56:35 UTC
just fixed
Comment 11 andreasmeier80 2004-01-11 13:04:11 UTC
It may be useful to have the tastcase on mainline