]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
OpenMP/C++: Use STRIP_REFERENCE_REF to fix declare variant with reference-returning...
authorTobias Burnus <tburnus@baylibre.com>
Thu, 31 Oct 2024 11:37:46 +0000 (12:37 +0100)
committerTobias Burnus <tburnus@baylibre.com>
Thu, 31 Oct 2024 11:37:46 +0000 (12:37 +0100)
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.

gcc/cp/decl.cc

index b638f3af294d9f94fbe6069b36ce899b93aa1f6e..0e4533c6faba591eb9cc2c1469ee7c51a0b889f1 100644 (file)
@@ -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)