diff --git a/src/QANCollection/QANCollection_Handle.cxx b/src/QANCollection/QANCollection_Handle.cxx index 391beace34..4642aea498 100644 --- a/src/QANCollection/QANCollection_Handle.cxx +++ b/src/QANCollection/QANCollection_Handle.cxx @@ -187,11 +187,11 @@ static Standard_Integer QAHandleOps (Draw_Interpretor& theDI, #endif const Handle_Geom_Line& hTmpRef (Handle(Geom_Line)::DownCast (aCurve2)); CHECK(theDI, hTmpRef.get() == aCurve2.get(), "local reference to temporary object (Handle_)"); -#if defined(__GNUC__) && (__GNUC__ > 11) -#pragma GCC diagnostic pop -#endif // check lifetime of temporary object referenced by local variable (base type) const Handle_Geom_Curve& hTmpRefBase (Handle(Geom_Line)::DownCast (aCurve2)); + #if defined(__GNUC__) && (__GNUC__ > 11) +#pragma GCC diagnostic pop +#endif // here we have different behavior for MSVC 2013+ where Handle_ is a class // (compiler creates temporary object of approprtiate type and keeps it living // until the reference is valid) and other compilers where Handle_ is