Bug 26155 - ICE after error with namespace alias
Summary: ICE after error with namespace alias
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.8.0
Assignee: Paolo Carlini
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2006-02-07 14:48 UTC by Andrew Pinski
Modified: 2012-06-01 16:13 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 2.95.3, 3.0.4, 3.2.3, 3.3.3, 3.4.0, 4.0.0, 4.1.0, 4.2.0
Last reconfirmed: 2006-09-03 21:39:26


Attachments
patch (1.57 KB, patch)
2006-02-08 21:40 UTC, Benjamin Kosnik
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2006-02-07 14:48:26 UTC
I thought this was filed before but I cannot find it.
Testcase:
namespace std
{
  namespace __gnu_debug {
namespace debug = std::__gnu_debug;
namespace debug
{
-----
Error we get:
t.ii:6: error: namespace alias ‘std::__gnu_debug::debug’ not allowed here, assuming ‘std::__gnu_debug’
t.ii:6: internal compiler error: in resume_scope, at cp/name-lookup.c:1372
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Benjamin Kosnik 2006-02-08 21:40:56 UTC
Created attachment 10805 [details]
patch
Comment 2 Andrew Pinski 2006-02-09 00:41:28 UTC
Comment on attachment 10805 [details]
patch

This patch was submitted to the wrong bug.
Comment 3 Volker Reichelt 2006-02-09 16:51:44 UTC
Confirmed.

Even simpler testcase:

=======================
namespace N
{
  namespace M = N;
  namespace M {}
}
=======================
Comment 4 Matthias Klose 2009-03-24 10:40:11 UTC
confirmed with 4.3.4 and 4.4.0
Comment 5 Debian GCC Maintainers 2009-12-29 16:49:40 UTC
confirmed with trunk 20091228
Comment 6 Paolo Carlini 2012-05-29 16:14:58 UTC
On it.
Comment 7 paolo@gcc.gnu.org 2012-06-01 16:11:44 UTC
Author: paolo
Date: Fri Jun  1 16:11:38 2012
New Revision: 188113

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188113
Log:
/cp
2012-06-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/26155
	* name-lookup.c (push_namespace): When error recovery is
	impossible just error out in duplicate_decls.

/testsuite
2012-06-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/26155
	* g++.dg/parse/namespace-alias-1.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/parse/namespace-alias-1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/testsuite/ChangeLog
Comment 8 Paolo Carlini 2012-06-01 16:13:03 UTC
Fixed.