[flang] Changes that might fix MSVC build problems from sjs

Original-commit: flang-compiler/f18@009f0cc8df
Reviewed-on: https://github.com/flang-compiler/f18/pull/195
Tree-same-pre-rewrite: false
This commit is contained in:
peter klausler 2018-09-17 10:07:25 -07:00
parent 84af9c28f0
commit c2d4f07cda
3 changed files with 7 additions and 6 deletions

View file

@ -32,6 +32,7 @@
#include <functional>
#include <list>
#include <optional>
#include <string>
#include <tuple>
#include <type_traits>
#include <variant>

View file

@ -1256,7 +1256,7 @@ inline constexpr auto localRecovery(
// nextCh is a parser that succeeds if the parsing state is not
// at the end of its input, returning the next character location and
// advancing the parse when it does so.
constexpr struct NextCh {
struct NextCh {
using resultType = const char *;
constexpr NextCh() {}
std::optional<const char *> Parse(ParseState &state) const {
@ -1266,7 +1266,9 @@ constexpr struct NextCh {
state.Say("end of file"_err_en_US);
return std::nullopt;
}
} nextCh;
};
constexpr NextCh nextCh;
// If a is a parser for some nonstandard language feature LF, extension<LF>(a)
// is a parser that optionally enabled, sets a strict conformance violation

View file

@ -536,9 +536,8 @@ std::optional<DataRef> AsDataRef(Expr<Type<CAT, KIND>> &&expr) {
using Ty = std::decay_t<decltype(x)>;
if constexpr (common::HasMember<Ty, decltype(DataRef::u)>) {
return {DataRef{std::move(x)}};
} else {
return std::nullopt;
}
return std::nullopt;
},
std::move(designator->u));
} else {
@ -615,8 +614,7 @@ MaybeExpr ExprAnalyzer::Analyze(const parser::StructureComponent &sc) {
if (sym == nullptr) {
context.messages.Say(sc.component.source,
"component name was not resolved to a symbol"_err_en_US);
} else if (const auto *tpDetails{
sym->detailsIf<semantics::TypeParamDetails>()}) {
} else if (sym->detailsIf<semantics::TypeParamDetails>()) {
context.messages.Say(sc.component.source,
"TODO: type parameter inquiry unimplemented"_err_en_US);
} else if (&sym->owner() != dtExpr->result.spec().scope()) {