From 7ba393efe5fe861fe2905bb8c09801897fecc128 Mon Sep 17 00:00:00 2001 From: peter klausler Date: Tue, 3 Nov 2020 10:45:01 -0800 Subject: [PATCH] [flang] Dodge gcc 8.2.0 build problem (NFC) Add explicit member initializers to the declarations of some constexpr values added in a recent patch to avoid an apparent problem with gcc 8.2.0 with default initializers. Differential revision: https://reviews.llvm.org/D90696 --- flang/lib/Evaluate/intrinsics.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/flang/lib/Evaluate/intrinsics.cpp b/flang/lib/Evaluate/intrinsics.cpp index 8154b7d..60e8eee 100644 --- a/flang/lib/Evaluate/intrinsics.cpp +++ b/flang/lib/Evaluate/intrinsics.cpp @@ -207,26 +207,28 @@ struct IntrinsicDummyArgument { // KIND(0), KIND(0.0), KIND(''), &c. value for the function result. static constexpr IntrinsicDummyArgument DefaultingKIND{"kind", {IntType, KindCode::kindArg}, Rank::scalar, - Optionality::defaultsToDefaultForResult}; + Optionality::defaultsToDefaultForResult, common::Intent::In}; // MatchingDefaultKIND is a KIND= argument whose default value is the // kind of any "Same" function argument (viz., the one whose kind pattern is // "same"). static constexpr IntrinsicDummyArgument MatchingDefaultKIND{"kind", - {IntType, KindCode::kindArg}, Rank::scalar, - Optionality::defaultsToSameKind}; + {IntType, KindCode::kindArg}, Rank::scalar, Optionality::defaultsToSameKind, + common::Intent::In}; // SizeDefaultKind is a KIND= argument whose default value should be // the kind of INTEGER used for address calculations, and can be // set so with a compiler flag; but the standard mandates the // kind of default INTEGER. static constexpr IntrinsicDummyArgument SizeDefaultKIND{"kind", - {IntType, KindCode::kindArg}, Rank::scalar, - Optionality::defaultsToSizeKind}; -static constexpr IntrinsicDummyArgument RequiredDIM{ - "dim", {IntType, KindCode::dimArg}, Rank::scalar, Optionality::required}; -static constexpr IntrinsicDummyArgument OptionalDIM{ - "dim", {IntType, KindCode::dimArg}, Rank::scalar, Optionality::optional}; -static constexpr IntrinsicDummyArgument OptionalMASK{ - "mask", AnyLogical, Rank::conformable, Optionality::optional}; + {IntType, KindCode::kindArg}, Rank::scalar, Optionality::defaultsToSizeKind, + common::Intent::In}; +static constexpr IntrinsicDummyArgument RequiredDIM{"dim", + {IntType, KindCode::dimArg}, Rank::scalar, Optionality::required, + common::Intent::In}; +static constexpr IntrinsicDummyArgument OptionalDIM{"dim", + {IntType, KindCode::dimArg}, Rank::scalar, Optionality::optional, + common::Intent::In}; +static constexpr IntrinsicDummyArgument OptionalMASK{"mask", AnyLogical, + Rank::conformable, Optionality::optional, common::Intent::In}; struct IntrinsicInterface { static constexpr int maxArguments{7}; // if not a MAX/MIN(...) -- 2.7.4