forked from OSchip/llvm-project
[OPENMP] Restore allowing of braced initializers in the declare reduction
init. Braced initializers were not accepted after the last fix in the initialier.Restored previous functionality.
This commit is contained in:
parent
3ddfb04f41
commit
1fcc9b6ff8
|
@ -430,7 +430,7 @@ void Parser::ParseOpenMPReductionInitializerForDecl(VarDecl *OmpPrivParm) {
|
|||
}
|
||||
|
||||
PreferredType.enterVariableInit(Tok.getLocation(), OmpPrivParm);
|
||||
ExprResult Init = ParseAssignmentExpression();
|
||||
ExprResult Init = ParseInitializer();
|
||||
|
||||
if (Init.isInvalid()) {
|
||||
SkipUntil(tok::r_paren, tok::annot_pragma_openmp_end, StopBeforeMatch);
|
||||
|
|
|
@ -45,6 +45,8 @@ struct S {
|
|||
int s;
|
||||
};
|
||||
#pragma omp declare reduction(+: struct S: omp_out.s += omp_in.s) // initializer(omp_priv = { .s = 0 })
|
||||
#pragma omp declare reduction(&: struct S: omp_out.s += omp_in.s) initializer(omp_priv = { .s = 0 })
|
||||
#pragma omp declare reduction(|: struct S: omp_out.s += omp_in.s) initializer(omp_priv = { 0 })
|
||||
|
||||
int fun(int arg) {
|
||||
struct S s;// expected-note {{'s' defined here}}
|
||||
|
|
Loading…
Reference in New Issue