diff options
author | Jason Merrill <jason@redhat.com> | 2014-08-15 17:59:40 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-08-15 17:59:40 -0400 |
commit | 5802281eb634b1efcd139cdb5867a8077e7eca03 (patch) | |
tree | e67cb1575d9bbab9d61cafcb08483a12596b5273 /gcc/cp/lambda.c | |
parent | 5b33845084ba98bc0bc87c7220254b3ab4999ed5 (diff) | |
download | gcc-5802281eb634b1efcd139cdb5867a8077e7eca03.zip gcc-5802281eb634b1efcd139cdb5867a8077e7eca03.tar.gz gcc-5802281eb634b1efcd139cdb5867a8077e7eca03.tar.bz2 |
re PR c++/61566 (ICE in write_unscoped_name)
PR c++/61566
* pt.c (instantiate_class_template_1): Ignore lambda on
CLASSTYPE_DECL_LIST.
(push_template_decl_real): A lambda is not primary.
(lookup_template_class_1): Don't look for a lambda partial
instantiation.
* lambda.c (maybe_add_lambda_conv_op): Distinguish between being
currently in a function and the lambda living in a function.
* mangle.c (CLASSTYPE_TEMPLATE_ID_P): False for lambda.
From-SVN: r214046
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r-- | gcc/cp/lambda.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 169f438..ddaa940 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -824,6 +824,7 @@ void maybe_add_lambda_conv_op (tree type) { bool nested = (current_function_decl != NULL_TREE); + bool nested_def = decl_function_context (TYPE_MAIN_DECL (type)); tree callop = lambda_function (type); if (LAMBDA_EXPR_CAPTURE_LIST (CLASSTYPE_LAMBDA_EXPR (type)) != NULL_TREE) @@ -976,7 +977,7 @@ maybe_add_lambda_conv_op (tree type) DECL_NOT_REALLY_EXTERN (fn) = 1; DECL_DECLARED_INLINE_P (fn) = 1; DECL_ARGUMENTS (fn) = build_this_parm (fntype, TYPE_QUAL_CONST); - if (nested) + if (nested_def) DECL_INTERFACE_KNOWN (fn) = 1; if (generic_lambda_p) @@ -1016,7 +1017,7 @@ maybe_add_lambda_conv_op (tree type) DECL_NAME (arg) = NULL_TREE; DECL_CONTEXT (arg) = fn; } - if (nested) + if (nested_def) DECL_INTERFACE_KNOWN (fn) = 1; if (generic_lambda_p) |