Skip to content

Commit c78ccaf

Browse files
erichkeaneGeorgeARM
authored andcommitted
[OpenACC][NFC] Fix GCC7 build after fec003a
A GCC 7 requirement on the completeness of types before using them in a variant means we need a constructor for these (or define them outside the current thing). This patch should fix the build, as reported by @Kewen12
1 parent 64e2b34 commit c78ccaf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/include/clang/Sema/SemaOpenACC.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ class SemaOpenACC : public SemaBase {
135135
struct RangeForInfo {
136136
const CXXForRangeStmt *Uninstantiated = nullptr;
137137
const CXXForRangeStmt *CurrentVersion = nullptr;
138+
// GCC 7.x requires this constructor, else the construction of variant
139+
// doesn't work correctly.
140+
RangeForInfo() : Uninstantiated{nullptr}, CurrentVersion{nullptr} {}
141+
RangeForInfo(const CXXForRangeStmt *Uninst, const CXXForRangeStmt *Cur)
142+
: Uninstantiated{Uninst}, CurrentVersion{Cur} {}
138143
};
139144

140145
struct ForInfo {

0 commit comments

Comments
 (0)