diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-09-14 22:18:17 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-09-14 22:18:17 +0200 |
commit | 8b5865104c57edfc56c5a10bcbcdbaf8b527658f (patch) | |
tree | 3d7d0e0c7d54b8b34774a1e25e74a48dc3f235e1 /gcc | |
parent | 595ced60609a353b91face2f87b6f7abe3eaf28c (diff) | |
download | gcc-8b5865104c57edfc56c5a10bcbcdbaf8b527658f.zip gcc-8b5865104c57edfc56c5a10bcbcdbaf8b527658f.tar.gz gcc-8b5865104c57edfc56c5a10bcbcdbaf8b527658f.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/cp-gimplify.c | 4 |
2 files changed, 10 insertions, 0 deletions
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 <jakub@redhat.com> + + PR c++/81314 + * cp-gimplify.c (omp_var_to_track): Look through references. + (omp_cxx_notice_variable): Likewise. + 2017-09-13 Nathan Sidwell <nathan@acm.org> 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); |