Skip to content
Snippets Groups Projects
Commit b67a0d6a authored by Tobias Burnus's avatar Tobias Burnus
Browse files

OpenMP/C++: Fix 'declare variant' for struct-returning functions [PR118486]

To find the variant declaration, a call is constructed in
omp_declare_variant_finalize_one, which gives here:
  TARGET_EXPR <D.3010, variant_fn ()>

Extracting now the function declaration failed and gave the bogus
  error: could not find variant declaration

Solution: Use the 2nd argument of the TARGET_EXPR and continue.

	PR c++/118486

gcc/cp/ChangeLog:

	* decl.cc (omp_declare_variant_finalize_one): When resolving
	the variant to use, handle variant calls with TARGET_EXPR.

gcc/testsuite/ChangeLog:

	* g++.dg/gomp/declare-variant-11.C: New test.
parent dd389c25
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment