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
This commit is contained in:
parent
9656bc0fdc
commit
1b021ff438
@ -1,3 +1,9 @@
|
||||
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>
|
||||
|
||||
PR c++/33516
|
||||
|
@ -8153,7 +8153,8 @@ grokdeclarator (const cp_declarator *declarator,
|
||||
type_quals = TYPE_UNQUALIFIED;
|
||||
|
||||
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);
|
||||
type = build_memfn_type (type,
|
||||
|
@ -1,3 +1,8 @@
|
||||
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>
|
||||
|
||||
PR middle-end/32931
|
||||
|
5
gcc/testsuite/g++.dg/other/ptrmem9.C
Normal file
5
gcc/testsuite/g++.dg/other/ptrmem9.C
Normal file
@ -0,0 +1,5 @@
|
||||
// PR c++/33969
|
||||
// { dg-do compile }
|
||||
|
||||
struct A;
|
||||
void (*A::* fp)() const; // { dg-error "invalid in variable declaration" }
|
Loading…
x
Reference in New Issue
Block a user