aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-11-07 20:10:43 -0500
committerJason Merrill <jason@gcc.gnu.org>2011-11-07 20:10:43 -0500
commit7e72c65d183305bf9986be8404e01047a0a3d07b (patch)
tree285d9544c124311722b9d98af5ed9439596be87f /gcc/cp
parent029ac5f967194c0570c3176edd06301dcbab7cb1 (diff)
downloadgcc-7e72c65d183305bf9986be8404e01047a0a3d07b.zip
gcc-7e72c65d183305bf9986be8404e01047a0a3d07b.tar.gz
gcc-7e72c65d183305bf9986be8404e01047a0a3d07b.tar.bz2
re PR c++/50848 (ICE in derived template class missing using for member of template base class)
PR c++/50848 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Don't crash if lookup finds a non-function. From-SVN: r181143
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/pt.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 92025a9..98e0fe3 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2011-11-07 Jason Merrill <jason@redhat.com>
+ PR c++/50848
+ * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Don't crash
+ if lookup finds a non-function.
+
PR c++/50863
* parser.c (cp_parser_initializer_list): Parse C99
array designators tentatively.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 53a5358..bf2a2c63 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -13673,6 +13673,8 @@ tsubst_copy_and_build (tree t,
if (unq != function)
{
tree fn = unq;
+ if (TREE_CODE (fn) == INDIRECT_REF)
+ fn = TREE_OPERAND (fn, 0);
if (TREE_CODE (fn) == COMPONENT_REF)
fn = TREE_OPERAND (fn, 1);
if (is_overloaded_fn (fn))
@@ -13682,7 +13684,9 @@ tsubst_copy_and_build (tree t,
"and no declarations were found by "
"argument-dependent lookup at the point "
"of instantiation", function);
- if (DECL_CLASS_SCOPE_P (fn))
+ if (!DECL_P (fn))
+ /* Can't say anything more. */;
+ else if (DECL_CLASS_SCOPE_P (fn))
{
inform (EXPR_LOC_OR_HERE (t),
"declarations in dependent base %qT are "