aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>2003-11-18 15:54:22 +0000
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>2003-11-18 15:54:22 +0000
commitc44e68a5f70cca855b79dce8b8ba5c7274a8c731 (patch)
treebb256035baabb26b8721b836ce81c524c986d175 /gcc/cp/semantics.c
parentdf964a183fdc0fa5fae0409bfa305ee95b3b3d6b (diff)
downloadgcc-c44e68a5f70cca855b79dce8b8ba5c7274a8c731.zip
gcc-c44e68a5f70cca855b79dce8b8ba5c7274a8c731.tar.gz
gcc-c44e68a5f70cca855b79dce8b8ba5c7274a8c731.tar.bz2
re PR c++/12932 (ICE with use of ptr-to-function as template arg)
PR c++/12932 * class.c (currently_open_derived_class): Check if current_class_type is NULL_TREE. * semantics.c (finish_call_expr): Check if currently_open_derived_class returns NULL_TREE. * cp-tree.h (DERIVED_FROM_P): Add parenthesis around PARENT parameter. * g++.dg/template/static5.C: New test. From-SVN: r73705
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 13d8734..cb25972 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1638,6 +1638,8 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p)
if (DECL_FUNCTION_MEMBER_P (f))
{
tree type = currently_open_derived_class (DECL_CONTEXT (f));
+ if (!type)
+ type = DECL_CONTEXT (f);
fn = build_baselink (TYPE_BINFO (type),
TYPE_BINFO (type),
fn, /*optype=*/NULL_TREE);