From 8b5865104c57edfc56c5a10bcbcdbaf8b527658f Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 14 Sep 2017 22:18:17 +0200 Subject: re PR c++/81314 (Undefined reference to a function with -fopenmp) PR c++/81314 * cp-gimplify.c (omp_var_to_track): Look through references. (omp_cxx_notice_variable): Likewise. * testsuite/libgomp.c++/pr81314.C: New test. From-SVN: r252770 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/cp-gimplify.c | 4 ++++ 2 files changed, 10 insertions(+) (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c0b7ba2..1bda581 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2017-09-14 Jakub Jelinek + + PR c++/81314 + * cp-gimplify.c (omp_var_to_track): Look through references. + (omp_cxx_notice_variable): Likewise. + 2017-09-13 Nathan Sidwell Conv-op identifers not in identifier hash table diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index 4a52aa5..262485a 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -895,6 +895,8 @@ omp_var_to_track (tree decl) tree type = TREE_TYPE (decl); if (is_invisiref_parm (decl)) type = TREE_TYPE (type); + else if (TREE_CODE (type) == REFERENCE_TYPE) + type = TREE_TYPE (type); while (TREE_CODE (type) == ARRAY_TYPE) type = TREE_TYPE (type); if (type == error_mark_node || !CLASS_TYPE_P (type)) @@ -947,6 +949,8 @@ omp_cxx_notice_variable (struct cp_genericize_omp_taskreg *omp_ctx, tree decl) tree type = TREE_TYPE (decl); if (is_invisiref_parm (decl)) type = TREE_TYPE (type); + else if (TREE_CODE (type) == REFERENCE_TYPE) + type = TREE_TYPE (type); while (TREE_CODE (type) == ARRAY_TYPE) type = TREE_TYPE (type); get_copy_ctor (type, tf_none); -- cgit v1.1