Commit 1b021ff4 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/33969 (ICE with const and function pointer)

	PR c++/33969
	* decl.c (grokdeclarator): Don't call build_memfn_type if type
	is neither FUNCTION_TYPE nor METHOD_TYPE.

	* g++.dg/other/ptrmem9.C: New test.

From-SVN: r129895
parent 9656bc0f
2007-11-05 Jakub Jelinek <jakub@redhat.com>
PR c++/33969
* decl.c (grokdeclarator): Don't call build_memfn_type if type
is neither FUNCTION_TYPE nor METHOD_TYPE.
2007-11-02 Jakub Jelinek <jakub@redhat.com> 2007-11-02 Jakub Jelinek <jakub@redhat.com>
PR c++/33516 PR c++/33516
......
...@@ -8153,7 +8153,8 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -8153,7 +8153,8 @@ grokdeclarator (const cp_declarator *declarator,
type_quals = TYPE_UNQUALIFIED; type_quals = TYPE_UNQUALIFIED;
if (declarator->kind == cdk_ptrmem if (declarator->kind == cdk_ptrmem
&& (TREE_CODE (type) == FUNCTION_TYPE || memfn_quals)) && (TREE_CODE (type) == FUNCTION_TYPE
|| (memfn_quals && TREE_CODE (type) == METHOD_TYPE)))
{ {
memfn_quals |= cp_type_quals (type); memfn_quals |= cp_type_quals (type);
type = build_memfn_type (type, type = build_memfn_type (type,
......
2007-11-05 Jakub Jelinek <jakub@redhat.com>
PR c++/33969
* g++.dg/other/ptrmem9.C: New test.
2007-11-04 Andrew Pinski <pinskia@gmail.com> 2007-11-04 Andrew Pinski <pinskia@gmail.com>
PR middle-end/32931 PR middle-end/32931
// PR c++/33969
// { dg-do compile }
struct A;
void (*A::* fp)() const; // { dg-error "invalid in variable declaration" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment