aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorTobias Burnus <tburnus@baylibre.com>2024-10-31 12:37:46 +0100
committerTobias Burnus <tburnus@baylibre.com>2024-10-31 12:37:46 +0100
commitf7ae087ef0132b01c3a2c04932058b996ebda18d (patch)
treefdf99ba3ea5658320046bcf003ccacfa96292a48 /gcc/cp
parenteb828a1e380e7bb5a708c899081541ee9130ff87 (diff)
downloadgcc-f7ae087ef0132b01c3a2c04932058b996ebda18d.zip
gcc-f7ae087ef0132b01c3a2c04932058b996ebda18d.tar.gz
gcc-f7ae087ef0132b01c3a2c04932058b996ebda18d.tar.bz2
OpenMP/C++: Use STRIP_REFERENCE_REF to fix declare variant with reference-returning functions
As Jakub suggested, use STRIP_REFERENCE_REF instead of doing it manually as r15-4800-geb828a1e380e7b did. gcc/cp/ChangeLog: * decl.cc (omp_declare_variant_finalize_one): Use STRIP_REFERENCE_REF instead of doing it manually.
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/decl.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc
index b638f3a..0e4533c 100644
--- a/gcc/cp/decl.cc
+++ b/gcc/cp/decl.cc
@@ -8375,10 +8375,7 @@ omp_declare_variant_finalize_one (tree decl, tree attr)
if (variant == error_mark_node && !processing_template_decl)
return true;
- if (TREE_CODE (variant) == INDIRECT_REF)
- variant = TREE_OPERAND (variant, 0);
-
- variant = cp_get_callee_fndecl_nofold (variant);
+ variant = cp_get_callee_fndecl_nofold (STRIP_REFERENCE_REF (variant));
input_location = save_loc;
if (variant)