[Bug c++/57444] New: ICE in instantiate_type for invalid use of member with using-declaration
frankhb1989 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue May 28 19:25:00 GMT 2013
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.
More information about the Gcc-bugs
mailing list