Bug 27933 - [4.0/4.1/4.2 Regression] ICE with invalid "using"
Summary: [4.0/4.1/4.2 Regression] ICE with invalid "using"
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.0.4
Assignee: Volker Reichelt
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2006-06-07 16:29 UTC by Volker Reichelt
Modified: 2006-06-12 21:24 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2006-06-07 16:29:17 UTC
The following invalid code snippet triggers an ICE since GCC 3.4.0:

===============================
template<int> struct A
{
    int i;
    A() { using i; }
};

A<0> b;
===============================

bug.cc: In constructor 'A<<anonymous> >::A()':
bug.cc:4: error: expected nested-name-specifier before 'i'
bug.cc:4: error: 'i' not declared
bug.cc: In constructor 'A<<anonymous> >::A() [with int <anonymous> = 0]':
bug.cc:7:   instantiated from here
bug.cc:4: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]

Will post a patch soon.
Comment 1 patchapp@dberlin.org 2006-06-07 16:35:20 UTC
Subject: Bug number PR c++/27933

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00368.html
Comment 2 Volker Reichelt 2006-06-12 21:13:01 UTC
Subject: Bug 27933

Author: reichelt
Date: Mon Jun 12 21:12:52 2006
New Revision: 114580

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114580
Log:
	PR c++/27933
	* name-lookup.c (lookup_qualified_name): Always return error_mark_node
	if lookup fails.

	* g++.dg/lookup/using15.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/lookup/using15.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/testsuite/ChangeLog

Comment 3 Volker Reichelt 2006-06-12 21:18:33 UTC
Subject: Bug 27933

Author: reichelt
Date: Mon Jun 12 21:18:20 2006
New Revision: 114581

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114581
Log:
	PR c++/27933
	* name-lookup.c (lookup_qualified_name): Always return error_mark_node
	if lookup fails.

	* g++.dg/lookup/using15.C: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/lookup/using15.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/name-lookup.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog

Comment 4 Volker Reichelt 2006-06-12 21:23:42 UTC
Subject: Bug 27933

Author: reichelt
Date: Mon Jun 12 21:23:30 2006
New Revision: 114582

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114582
Log:
	PR c++/27933
	* name-lookup.c (lookup_qualified_name): Always return error_mark_node
	if lookup fails.

	* g++.dg/lookup/using15.C: New test.

Added:
    branches/gcc-4_0-branch/gcc/testsuite/g++.dg/lookup/using15.C
Modified:
    branches/gcc-4_0-branch/gcc/cp/ChangeLog
    branches/gcc-4_0-branch/gcc/cp/name-lookup.c
    branches/gcc-4_0-branch/gcc/testsuite/ChangeLog

Comment 5 Volker Reichelt 2006-06-12 21:24:31 UTC
Fixed on mainline, 4.1 branch, and 4.0 branch.