diff options
author | Nathan Sidwell <nathan@acm.org> | 2018-03-19 18:56:22 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2018-03-19 18:56:22 +0000 |
commit | 143f00e1126c474e7caceba74747e3173b16e87c (patch) | |
tree | cad31708fc1f804780b65574cd159ff7f364ae1e /gcc/cp/lambda.c | |
parent | f7d884d45b929c3f0ab65b0830cce4517b5f968d (diff) | |
download | gcc-143f00e1126c474e7caceba74747e3173b16e87c.zip gcc-143f00e1126c474e7caceba74747e3173b16e87c.tar.gz gcc-143f00e1126c474e7caceba74747e3173b16e87c.tar.bz2 |
[PR c++/84835] ICE with generic lambda in extern "C"
https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00890.html
PR c++/84835
* lambda.c (maybe_add_lambda_conv_op): Force C++ linkage.
* pt.c (build_template_decl): Propagate language linkage.
PR c++/84835
* g++.dg/cpp1y/pr84835.C: New.
From-SVN: r258655
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r-- | gcc/cp/lambda.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index b3c75c8..3740606 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -1176,6 +1176,7 @@ maybe_add_lambda_conv_op (tree type) tree thistype = cp_build_qualified_type (type, TYPE_QUAL_CONST); tree fntype = build_method_type_directly (thistype, rettype, void_list_node); tree convfn = build_lang_decl (FUNCTION_DECL, name, fntype); + SET_DECL_LANGUAGE (convfn, lang_cplusplus); tree fn = convfn; DECL_SOURCE_LOCATION (fn) = DECL_SOURCE_LOCATION (callop); SET_DECL_ALIGN (fn, MINIMUM_METHOD_BOUNDARY); @@ -1208,6 +1209,7 @@ maybe_add_lambda_conv_op (tree type) name = get_identifier ("_FUN"); tree statfn = build_lang_decl (FUNCTION_DECL, name, stattype); + SET_DECL_LANGUAGE (statfn, lang_cplusplus); fn = statfn; DECL_SOURCE_LOCATION (fn) = DECL_SOURCE_LOCATION (callop); grokclassfn (type, fn, NO_SPECIAL); |