aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2016-09-26 09:42:50 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2016-09-26 09:42:50 +0000
commit81fea426da8c4687bb32e6894dc26f00ae211822 (patch)
tree8b84b3de175727d09b7dcf1b5703e0d46b64f9e7 /gcc/cp/pt.c
parent392fa55c799358e198ca85fbea548e60359133c5 (diff)
downloadgcc-81fea426da8c4687bb32e6894dc26f00ae211822.zip
gcc-81fea426da8c4687bb32e6894dc26f00ae211822.tar.gz
gcc-81fea426da8c4687bb32e6894dc26f00ae211822.tar.bz2
Implement -Wimplicit-fallthrough.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r240485
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 29d8beb..a0cbb2e 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -16556,7 +16556,16 @@ tsubst_copy_and_build (tree t,
tree ret;
function = CALL_EXPR_FN (t);
- /* When we parsed the expression, we determined whether or
+ if (function == NULL_TREE)
+ {
+ /* If you hit this assert, it means that you're trying to tsubst
+ an internal function with arguments. This isn't yet supported,
+ so you need to build another internal call with the tsubsted
+ arguments after the arguments have been tsubsted down below. */
+ gcc_assert (call_expr_nargs (t) == 0);
+ RETURN (t);
+ }
+ /* When we parsed the expression, we determined whether or
not Koenig lookup should be performed. */
koenig_p = KOENIG_LOOKUP_P (t);
if (TREE_CODE (function) == SCOPE_REF)
@@ -22787,7 +22796,7 @@ instantiation_dependent_scope_ref_p (tree t)
bool
value_dependent_expression_p (tree expression)
{
- if (!processing_template_decl)
+ if (!processing_template_decl || expression == NULL_TREE)
return false;
/* A name declared with a dependent type. */