[OPENMP] Fix DSA processing for member declaration.

If the member declaration is captured in the OMPCapturedExprDecl, we may
loose data-sharing attribute info for this declaration. Patch fixes this
bug.

llvm-svn: 308629
This commit is contained in:
Alexey Bataev 2017-07-20 16:47:47 +00:00
parent 22058c3fbb
commit 4d4624c20c
54 changed files with 147 additions and 139 deletions

View File

@ -1848,8 +1848,10 @@ Sema::BuildFieldReferenceExpr(Expr *BaseExpr, bool IsArrow,
if (getLangOpts().OpenMP && IsArrow &&
!CurContext->isDependentContext() &&
isa<CXXThisExpr>(Base.get()->IgnoreParenImpCasts())) {
if (auto *PrivateCopy = IsOpenMPCapturedDecl(Field))
return getOpenMPCapturedExpr(PrivateCopy, VK, OK, OpLoc);
if (auto *PrivateCopy = IsOpenMPCapturedDecl(Field)) {
return getOpenMPCapturedExpr(PrivateCopy, VK, OK,
MemberNameInfo.getLoc());
}
}
return BuildMemberExpr(*this, Context, Base.get(), IsArrow, OpLoc, SS,

View File

@ -55,7 +55,7 @@ public:
Expr *RefExpr = nullptr;
DeclRefExpr *PrivateCopy = nullptr;
SourceLocation ImplicitDSALoc;
DSAVarData() {}
DSAVarData() = default;
};
typedef llvm::SmallVector<std::pair<Expr *, OverloadedOperatorKind>, 4>
OperatorOffsetTy;
@ -112,7 +112,7 @@ private:
Scope *CurScope, SourceLocation Loc)
: Directive(DKind), DirectiveName(Name), CurScope(CurScope),
ConstructLoc(Loc) {}
SharingMapTy() {}
SharingMapTy() = default;
};
typedef SmallVector<SharingMapTy, 4> StackTy;
@ -479,7 +479,25 @@ bool isParallelOrTaskRegion(OpenMPDirectiveKind DKind) {
}
} // namespace
static Expr *getExprAsWritten(Expr *E) {
if (auto *ExprTemp = dyn_cast<ExprWithCleanups>(E))
E = ExprTemp->getSubExpr();
if (auto *MTE = dyn_cast<MaterializeTemporaryExpr>(E))
E = MTE->GetTemporaryExpr();
while (auto *Binder = dyn_cast<CXXBindTemporaryExpr>(E))
E = Binder->getSubExpr();
if (auto *ICE = dyn_cast<ImplicitCastExpr>(E))
E = ICE->getSubExprAsWritten();
return E->IgnoreParens();
}
static ValueDecl *getCanonicalDecl(ValueDecl *D) {
if (auto *CED = dyn_cast<OMPCapturedExprDecl>(D))
if (auto *ME = dyn_cast<MemberExpr>(getExprAsWritten(CED->getInit())))
D = ME->getMemberDecl();
auto *VD = dyn_cast<VarDecl>(D);
auto *FD = dyn_cast<FieldDecl>(D);
if (VD != nullptr) {
@ -821,6 +839,7 @@ DSAStackTy::DSAVarData DSAStackTy::getTopDSA(ValueDecl *D, bool FromParent) {
DVar.PrivateCopy = I->SharingMap[D].PrivateCopy;
DVar.CKind = I->SharingMap[D].Attributes;
DVar.ImplicitDSALoc = I->DefaultAttrLoc;
DVar.DKind = I->Directive;
}
return DVar;
@ -3053,21 +3072,6 @@ bool OpenMPIterationSpaceChecker::Dependent() const {
(Step && Step->isValueDependent());
}
static Expr *getExprAsWritten(Expr *E) {
if (auto *ExprTemp = dyn_cast<ExprWithCleanups>(E))
E = ExprTemp->getSubExpr();
if (auto *MTE = dyn_cast<MaterializeTemporaryExpr>(E))
E = MTE->GetTemporaryExpr();
while (auto *Binder = dyn_cast<CXXBindTemporaryExpr>(E))
E = Binder->getSubExpr();
if (auto *ICE = dyn_cast<ImplicitCastExpr>(E))
E = ICE->getSubExprAsWritten();
return E->IgnoreParens();
}
bool OpenMPIterationSpaceChecker::SetLCDeclAndLB(ValueDecl *NewLCDecl,
Expr *NewLCRefExpr,
Expr *NewLB) {
@ -3249,12 +3253,8 @@ static const ValueDecl *GetInitLCDecl(Expr *E) {
CE->getNumArgs() > 0 && CE->getArg(0) != nullptr)
E = CE->getArg(0)->IgnoreParenImpCasts();
if (auto *DRE = dyn_cast_or_null<DeclRefExpr>(E)) {
if (auto *VD = dyn_cast<VarDecl>(DRE->getDecl())) {
if (auto *CED = dyn_cast<OMPCapturedExprDecl>(VD))
if (auto *ME = dyn_cast<MemberExpr>(getExprAsWritten(CED->getInit())))
return getCanonicalDecl(ME->getMemberDecl());
if (auto *VD = dyn_cast<VarDecl>(DRE->getDecl()))
return getCanonicalDecl(VD);
}
}
if (auto *ME = dyn_cast_or_null<MemberExpr>(E))
if (ME->isArrow() && isa<CXXThisExpr>(ME->getBase()->IgnoreParenImpCasts()))
@ -8097,7 +8097,8 @@ getPrivateItem(Sema &S, Expr *&RefExpr, SourceLocation &ELoc,
}
return std::make_pair(nullptr, false);
}
return std::make_pair(DE ? DE->getDecl() : ME->getMemberDecl(), false);
return std::make_pair(
getCanonicalDecl(DE ? DE->getDecl() : ME->getMemberDecl()), false);
}
OMPClause *Sema::ActOnOpenMPPrivateClause(ArrayRef<Expr *> VarList,
@ -8981,7 +8982,6 @@ static bool ActOnOMPReductionKindClause(
// C++
// reduction-identifier is either an id-expression or one of the following
// operators: +, -, *, &, |, ^, && and ||
// FIXME: Only 'min' and 'max' identifiers are supported for now.
switch (OOK) {
case OO_Plus:
case OO_Minus:
@ -9044,7 +9044,7 @@ static bool ActOnOMPReductionKindClause(
case NUM_OVERLOADED_OPERATORS:
llvm_unreachable("Unexpected reduction identifier");
case OO_None:
if (auto II = DN.getAsIdentifierInfo()) {
if (auto *II = DN.getAsIdentifierInfo()) {
if (II->isStr("max"))
BOK = BO_GT;
else if (II->isStr("min"))
@ -9055,6 +9055,8 @@ static bool ActOnOMPReductionKindClause(
SourceRange ReductionIdRange;
if (ReductionIdScopeSpec.isValid())
ReductionIdRange.setBegin(ReductionIdScopeSpec.getBeginLoc());
else
ReductionIdRange.setBegin(ReductionId.getBeginLoc());
ReductionIdRange.setEnd(ReductionId.getEndLoc());
auto IR = UnresolvedReductions.begin(), ER = UnresolvedReductions.end();
@ -9166,6 +9168,7 @@ static bool ActOnOMPReductionKindClause(
<< getOpenMPClauseName(ClauseKind);
if (DVar.RefExpr)
S.Diag(DVar.RefExpr->getExprLoc(), diag::note_omp_referenced);
continue;
} else if (DVar.CKind != OMPC_unknown) {
S.Diag(ELoc, diag::err_omp_wrong_dsa)
<< getOpenMPClauseName(DVar.CKind)
@ -9453,9 +9456,10 @@ static bool ActOnOMPReductionKindClause(
S.BuildBinOp(Stack->getCurScope(), ReductionId.getLocStart(),
BO_Assign, LHSDRE, ConditionalOp);
}
ReductionOp = S.ActOnFinishFullExpr(ReductionOp.get());
if (ReductionOp.isUsable())
ReductionOp = S.ActOnFinishFullExpr(ReductionOp.get());
}
if (ReductionOp.isInvalid())
if (!ReductionOp.isUsable())
continue;
}
@ -9767,10 +9771,6 @@ static bool FinishOpenMPLinearClause(OMPLinearClause &Clause, DeclRefExpr *IV,
HasErrors = true;
continue;
}
if (auto *CED = dyn_cast<OMPCapturedExprDecl>(D)) {
D = cast<MemberExpr>(CED->getInit()->IgnoreParenImpCasts())
->getMemberDecl();
}
auto &&Info = Stack->isLoopControlVariable(D);
Expr *InitExpr = *CurInit;

View File

@ -18,9 +18,9 @@ public:
const S2 &operator =(const S2&) const;
S2 &operator =(const S2&);
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -27,9 +27,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -18,9 +18,9 @@ public:
const S2 &operator =(const S2&) const;
S2 &operator =(const S2&);
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -27,9 +27,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -18,9 +18,9 @@ public:
const S2 &operator =(const S2&) const;
S2 &operator =(const S2&);
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -27,9 +27,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -52,11 +52,11 @@ struct S {
// CHECK-NEXT: | |-OMPScheduleClause {{.+}} <col:61, col:79>
// CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} <col:78> 'int' <LValueToRValue>
// CHECK-NEXT: | | `-DeclRefExpr {{.+}} <col:78> 'int' lvalue OMPCapturedExpr {{.+}} '.capture_expr.' 'int'
// CHECK-NEXT: | |-CapturedStmt {{.+}} <line:40:5, <invalid sloc>>
// CHECK-NEXT: | |-CapturedStmt {{.+}} <line:40:5, line:41:9>
// CHECK-NEXT: | | |-CapturedDecl {{.+}} <<invalid sloc>> <invalid sloc>
// CHECK-NEXT: | | | |-ForStmt {{.+}} <col:5, <invalid sloc>>
// CHECK: | | | | `-UnaryOperator {{.+}} <line:41:7, <invalid sloc>> 'int' lvalue prefix '++'
// CHECK-NEXT: | | | | `-DeclRefExpr {{.+}} <<invalid sloc>> 'int' lvalue OMPCapturedExpr {{.+}} 'a' 'int &'
// CHECK-NEXT: | | | |-ForStmt {{.+}} <line:40:5, line:41:9>
// CHECK: | | | | `-UnaryOperator {{.+}} <line:41:7, col:9> 'int' lvalue prefix '++'
// CHECK-NEXT: | | | | `-DeclRefExpr {{.+}} <col:9> 'int' lvalue OMPCapturedExpr {{.+}} 'a' 'int &'
#pragma omp declare simd
#pragma omp declare simd inbranch

View File

@ -18,9 +18,9 @@ public:
const S2 &operator =(const S2&) const;
S2 &operator =(const S2&);
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -26,9 +26,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -18,9 +18,9 @@ public:
S2 &operator =(const S2&);
const S2 &operator =(const S2&) const;
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -26,9 +26,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -18,9 +18,9 @@ public:
S2 &operator=(const S2 &);
const S2 &operator=(const S2 &) const;
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -25,9 +25,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {
@ -61,6 +61,12 @@ class S5 {
public:
S5(int v) : a(v) {}
void foo() {
#pragma omp parallel private(a) // expected-note {{defined as private}}
#pragma omp for reduction(+:a) // expected-error {{reduction variable must be shared}}
for (int i = 0; i < 10; ++i)
::foo();
}
};
class S6 { // expected-note 3 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
#if __cplusplus >= 201103L // C++11 or later

View File

@ -17,9 +17,9 @@ public:
S2(S2 &s2) : a(s2.a) {}
const S2 &operator=(const S2 &) const;
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -25,9 +25,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -24,9 +24,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -17,9 +17,9 @@ public:
S2(S2 &s2) : a(s2.a) {}
const S2 &operator=(const S2 &) const;
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -26,9 +26,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -17,9 +17,9 @@ public:
S2(S2 &s2) : a(s2.a) {}
const S2 &operator=(const S2 &) const;
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -27,9 +27,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -17,9 +17,9 @@ public:
S2(S2 &s2) : a(s2.a) {}
const S2 &operator=(const S2 &) const;
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -25,9 +25,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -18,9 +18,9 @@ public:
S2 &operator=(const S2 &);
const S2 &operator=(const S2 &) const;
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -25,9 +25,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -18,9 +18,9 @@ public:
S2 &operator=(const S2 &);
const S2 &operator=(const S2 &) const;
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -25,9 +25,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -24,9 +24,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -18,9 +18,9 @@ public:
S2 &operator=(const S2 &);
const S2 &operator=(const S2 &) const;
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -25,9 +25,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -18,9 +18,9 @@ public:
const S2 &operator =(const S2&) const;
S2 &operator =(const S2&);
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -18,9 +18,9 @@ public:
const S2 &operator =(const S2&) const;
S2 &operator =(const S2&);
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -19,9 +19,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -18,9 +18,9 @@ public:
const S2 &operator =(const S2&) const;
S2 &operator =(const S2&);
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -19,9 +19,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -24,9 +24,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -18,9 +18,9 @@ public:
const S2 &operator =(const S2&) const;
S2 &operator =(const S2&);
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -19,9 +19,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -24,9 +24,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -24,9 +24,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -18,9 +18,9 @@ public:
const S2 &operator =(const S2&) const;
S2 &operator =(const S2&);
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -25,9 +25,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -18,9 +18,9 @@ public:
const S2 &operator =(const S2&) const;
S2 &operator =(const S2&);
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -25,9 +25,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -18,9 +18,9 @@ public:
const S2 &operator =(const S2&) const;
S2 &operator =(const S2&);
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -18,9 +18,9 @@ public:
const S2 &operator =(const S2&) const;
S2 &operator =(const S2&);
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -19,9 +19,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -18,9 +18,9 @@ public:
const S2 &operator =(const S2&) const;
S2 &operator =(const S2&);
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -19,9 +19,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -25,9 +25,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -18,9 +18,9 @@ public:
const S2 &operator =(const S2&) const;
S2 &operator =(const S2&);
static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note {{static data member is predetermined as shared}}
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
const float S2::S2sc = 0;
const S2 b;
const S2 ba[5];
class S3 {

View File

@ -19,9 +19,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {

View File

@ -25,9 +25,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
static const float S2sc;
static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {