This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/57444] New: ICE in instantiate_type for invalid use of member with using-declaration
- From: "frankhb1989 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 28 May 2013 19:25:10 +0000
- Subject: [Bug c++/57444] New: ICE in instantiate_type for invalid use of member with using-declaration
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57444
Bug ID: 57444
Summary: ICE in instantiate_type for invalid use of member with
using-declaration
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: frankhb1989 at gmail dot com
Case:
struct C
{
bool empty();
};
struct D : C
{
using C::empty;
};
int
main()
{
if(D().empty); // error expected but got ICE
}
Output:
a.cc: In function 'int main()':
a.cc:14:14: internal compiler error: in instantiate_type, at cp/class.c:7459
if(D().empty);
^
The output is OK after removing 'using C::empty;':
a.cc: In function 'int main()':
a.cc:13:14: error: cannot convert 'C::empty' from type 'bool (C::)()' to type
'bool'
if(D().empty);
^
A real example is using debug containers(std::__debug::vector/deque...) when
'empty()' is occasionally typoed as 'empty' in if-statement.