aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2022-10-10 17:55:04 -0400
committerNathan Sidwell <nathan@acm.org>2022-10-10 18:13:47 -0400
commitc7cb239f51788dbe3148368942b208934707b6a7 (patch)
tree5623c918585a6fb4aa69910b91dc982d2100933d /gcc/c-family
parent29b0fe393859729215b0db5d28f2faea30c6ec32 (diff)
downloadgcc-c7cb239f51788dbe3148368942b208934707b6a7.zip
gcc-c7cb239f51788dbe3148368942b208934707b6a7.tar.gz
gcc-c7cb239f51788dbe3148368942b208934707b6a7.tar.bz2
c++: Lambda context mangling
VAR and FIELD decls can become part of a lambda context, when the lambda is 'attached' to that entity (It's a C++20 ODR thing that was discovered with modules, but is actually separate.) We were not marking those decls as substitution candidates, leading to demangling failures and variance from other compilers. This patch bumps the ABI, and adds the contexts them to the substitution table. This is the intent of the ABI. gcc/ * common.opt (-fabi-version=): Document 18. * doc/invoke.texi (-fabi-version): Document 18. gcc/c-family/ * c-opts.cc (c_common_post_options): Bump abi to 18. gcc/cp/ * mangle.cc (write_prefix): Add VAR_DECL & FIELD_DECL to substitution table under abi=18. Note possible mismatch. gcc/testsuite/ * g++.dg/abi/lambda-ctx1-17.C: New. * g++.dg/abi/lambda-ctx1-18.C: New. * g++.dg/abi/lambda-ctx1-18vs17.C: New. * g++.dg/abi/lambda-ctx1.h: New. * g++.dg/abi/lambda-vis.C: Adjust expected mangles. * g++.dg/abi/macro0.C: Adjust.
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/c-opts.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c-family/c-opts.cc b/gcc/c-family/c-opts.cc
index babaa2f..55cebf6 100644
--- a/gcc/c-family/c-opts.cc
+++ b/gcc/c-family/c-opts.cc
@@ -975,7 +975,7 @@ c_common_post_options (const char **pfilename)
/* Change flag_abi_version to be the actual current ABI level, for the
benefit of c_cpp_builtins, and to make comparison simpler. */
- const int latest_abi_version = 17;
+ const int latest_abi_version = 18;
/* Generate compatibility aliases for ABI v13 (8.2) by default. */
const int abi_compat_default = 13;