User account creation filtered due to spam.

Bug 14821 - [3.4/4.0 Regression] Duplicate namespace alias declaration should not conflict
Summary: [3.4/4.0 Regression] Duplicate namespace alias declaration should not conflict
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P2 critical
Target Milestone: 3.4.1
Assignee: Mark Mitchell
Keywords: rejects-valid
Depends on:
Reported: 2004-04-02 11:10 UTC by Giovanni Bajo
Modified: 2004-10-30 21:11 UTC (History)
1 user (show)

See Also:
Known to work: 3.3.3
Known to fail: 3.4.0 4.0.0
Last reconfirmed: 2004-04-02 12:34:53


Note You need to log in before you can comment on or make changes to this bug.
Description Giovanni Bajo 2004-04-02 11:10:42 UTC
namespace A {
  namespace B {}

namespace A {
  namespace Alias = ::A::B;

namespace A {
  namespace Alias = ::A::B;
----------------------------------- error: declaration of `namespace Alias = A::B;' error: conflicts with previous declaration `namespace Alias = A:

This is obviously bogus, and breaks a library currently under review for Boost. 
The workaround is harder than one might think because the conflicting aliases 
come from different headers.
Comment 1 Andrew Pinski 2004-04-02 12:34:53 UTC
Comment 2 Mark Mitchell 2004-05-22 22:04:55 UTC
Working on a fix.
Comment 4 CVS Commits 2004-05-23 17:56:43 UTC
Subject: Bug 14821

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	2004-05-23 17:56:28

Modified files:
	gcc/cp         : ChangeLog name-lookup.c parser.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/other: ns1.C 
	gcc/testsuite/g++.dg/template: invalid1.C 

Log message:
	PR c++/14821
	* name-lookup.c (supplement_binding): Allow redefinitions of
	namespace aliases.
	PR c++/14883
	* parser.c (cp_parser_template_argument): Robustify.
	PR c++/14821
	* g++.dg/other/ns1.C: New test.
	PR c++/14883
	* g++.dg/template/invalid1.C: New test.


Comment 5 Mark Mitchell 2004-05-23 17:58:41 UTC
Fixed in GCC 3.4.1.