aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-11-05 09:10:09 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2007-11-05 09:10:09 +0100
commit1b021ff438d08470cb72ee3e8e75029bda7989f1 (patch)
tree365cb855f056e4fc4a1e9b2febd7ed9503df4555 /gcc/cp
parent9656bc0fdc7247299df8a105dff1f49d98f3e184 (diff)
downloadgcc-1b021ff438d08470cb72ee3e8e75029bda7989f1.zip
gcc-1b021ff438d08470cb72ee3e8e75029bda7989f1.tar.gz
gcc-1b021ff438d08470cb72ee3e8e75029bda7989f1.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1acce71..5eb1dce 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 9bab97b..990d943 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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,