Bug 90950 - OpenMP clause handling rejecting references to incomplete types in templates
Summary: OpenMP clause handling rejecting references to incomplete types in templates
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: 7.5
Assignee: Jakub Jelinek
URL:
Keywords: openmp
Depends on:
Blocks:
 
Reported: 2019-06-20 14:36 UTC by Jakub Jelinek
Modified: 2019-08-30 13:31 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2019-06-20 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2019-06-20 14:36:38 UTC
template <typename T>
T
foo (void)
{
  T y = 0;
  T &x = y;
  #pragma omp parallel for lastprivate (x)
  for (int i = 0; i < 8; ++i)
    x = i;
  return x;
}

int a = foo<int> ();

is incorrectly rejected.
Comment 1 Jakub Jelinek 2019-06-21 06:47:16 UTC
Author: jakub
Date: Fri Jun 21 06:46:45 2019
New Revision: 272543

URL: https://gcc.gnu.org/viewcvs?rev=272543&root=gcc&view=rev
Log:
	PR c++/90950
	* semantics.c (finish_omp_clauses): Don't reject references to
	incomplete types if processing_template_decl.

	* g++.dg/gomp/lastprivate-1.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/gomp/lastprivate-1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog
Comment 2 Jakub Jelinek 2019-06-28 22:11:34 UTC
Author: jakub
Date: Fri Jun 28 22:11:03 2019
New Revision: 272801

URL: https://gcc.gnu.org/viewcvs?rev=272801&root=gcc&view=rev
Log:
	Backported from mainline
	2019-06-21  Jakub Jelinek  <jakub@redhat.com>

	PR c++/90950
	* semantics.c (finish_omp_clauses): Don't reject references to
	incomplete types if processing_template_decl.

	* g++.dg/gomp/lastprivate-1.C: New test.

Added:
    branches/gcc-9-branch/gcc/testsuite/g++.dg/gomp/lastprivate-1.C
Modified:
    branches/gcc-9-branch/gcc/cp/ChangeLog
    branches/gcc-9-branch/gcc/cp/semantics.c
    branches/gcc-9-branch/gcc/testsuite/ChangeLog
Comment 3 Jakub Jelinek 2019-08-29 15:03:15 UTC
Author: jakub
Date: Thu Aug 29 15:02:44 2019
New Revision: 275042

URL: https://gcc.gnu.org/viewcvs?rev=275042&root=gcc&view=rev
Log:
	Backported from mainline
	2019-06-21  Jakub Jelinek  <jakub@redhat.com>

	PR c++/90950
	* semantics.c (finish_omp_clauses): Don't reject references to
	incomplete types if processing_template_decl.

	* g++.dg/gomp/lastprivate-1.C: New test.

Added:
    branches/gcc-8-branch/gcc/testsuite/g++.dg/gomp/lastprivate-1.C
Modified:
    branches/gcc-8-branch/gcc/cp/ChangeLog
    branches/gcc-8-branch/gcc/cp/semantics.c
    branches/gcc-8-branch/gcc/testsuite/ChangeLog
Comment 4 Jakub Jelinek 2019-08-30 12:47:23 UTC
Author: jakub
Date: Fri Aug 30 12:46:52 2019
New Revision: 275160

URL: https://gcc.gnu.org/viewcvs?rev=275160&root=gcc&view=rev
Log:
	Backported from mainline
	2019-06-21  Jakub Jelinek  <jakub@redhat.com>

	PR c++/90950
	* semantics.c (finish_omp_clauses): Don't reject references to
	incomplete types if processing_template_decl.

	* g++.dg/gomp/lastprivate-1.C: New test.

Added:
    branches/gcc-7-branch/gcc/testsuite/g++.dg/gomp/lastprivate-1.C
Modified:
    branches/gcc-7-branch/gcc/cp/ChangeLog
    branches/gcc-7-branch/gcc/cp/semantics.c
    branches/gcc-7-branch/gcc/testsuite/ChangeLog
Comment 5 Jakub Jelinek 2019-08-30 13:31:25 UTC
Fixed.