diff options
author | Jason Merrill <jason@redhat.com> | 2015-12-20 13:38:37 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2015-12-20 13:38:37 -0500 |
commit | 72013ec51a97b6a709ac96845a247119e4602254 (patch) | |
tree | 59fd6f52890fff5dd866d968ff4681528d076072 /gcc/cp/lambda.c | |
parent | b6b990219342543d804a269a5409091a93e6d2ea (diff) | |
download | gcc-72013ec51a97b6a709ac96845a247119e4602254.zip gcc-72013ec51a97b6a709ac96845a247119e4602254.tar.gz gcc-72013ec51a97b6a709ac96845a247119e4602254.tar.bz2 |
re PR c++/67411 (internal compiler error: in tsubst_copy, at cp/pt.c:13473)
PR c++/67411
* lambda.c (generic_lambda_fn_p): Split out from...
(maybe_add_lambda_conv_op): ...here.
* semantics.c (process_outer_var_ref): Don't defer maybe-constant
variables in a generic lambda.
* pt.c (instantiate_non_dependent_or_null): New.
* init.c (constant_value_1): Use it.
* cp-tree.h: Declare it and generic_lambda_fn_p.
From-SVN: r231863
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r-- | gcc/cp/lambda.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 8d1ee14..d50e48d 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -851,6 +851,16 @@ prepare_op_call (tree fn, int nargs) return t; } +/* Return true iff CALLOP is the op() for a generic lambda. */ + +bool +generic_lambda_fn_p (tree callop) +{ + return (LAMBDA_FUNCTION_P (callop) + && DECL_TEMPLATE_INFO (callop) + && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (callop))); +} + /* If the closure TYPE has a static op(), also add a conversion to function pointer. */ @@ -867,9 +877,7 @@ maybe_add_lambda_conv_op (tree type) if (processing_template_decl) return; - bool const generic_lambda_p - = (DECL_TEMPLATE_INFO (callop) - && DECL_TEMPLATE_RESULT (DECL_TI_TEMPLATE (callop)) == callop); + bool const generic_lambda_p = generic_lambda_fn_p (callop); if (!generic_lambda_p && DECL_INITIAL (callop) == NULL_TREE) { |