[flang] Remove support for Names in messages for now.

Original-commit: flang-compiler/f18@15d38c7059
Reviewed-on: https://github.com/flang-compiler/f18/pull/444
This commit is contained in:
peter klausler 2019-05-07 10:04:21 -07:00
parent f704d38129
commit 4ffb37e593
5 changed files with 16 additions and 24 deletions

View file

@ -163,7 +163,6 @@ private:
constexpr DynamicType() {}
};
template<TypeCategory CATEGORY, int KIND = 0> struct TypeBase {
static constexpr TypeCategory category{CATEGORY};
static constexpr int kind{KIND};

View file

@ -14,7 +14,6 @@
#include "message.h"
#include "char-set.h"
#include "parse-tree.h"
#include "../common/idioms.h"
#include <algorithm>
#include <cstdarg>
@ -86,16 +85,6 @@ const char *MessageFormattedText::Convert(CharBlock &&x) {
return Convert(x.ToString());
}
const char *MessageFormattedText::Convert(const Name &n) {
return Convert(n.source);
}
const char *MessageFormattedText::Convert(Name &n) { return Convert(n.source); }
const char *MessageFormattedText::Convert(Name &&n) {
return Convert(n.source);
}
std::string MessageExpectedText::ToString() const {
return std::visit(
common::visitors{

View file

@ -35,8 +35,6 @@
namespace Fortran::parser {
struct Name;
// Use "..."_err_en_US and "..."_en_US literals to define the static
// text and fatality of a message.
class MessageFixedText {
@ -70,9 +68,9 @@ constexpr MessageFixedText operator""_err_en_US(
// The construction of a MessageFormattedText uses a MessageFixedText
// as a vsnprintf() formatting string that is applied to the
// following arguments. CharBlock and std::string argument values are
// also supported; they are automatically converted into char pointers
// that are suitable for '%s' formatting.
// following arguments. CharBlock and std::string argument
// values are also supported; they are automatically converted into
// char pointers that are suitable for '%s' formatting.
class MessageFormattedText {
public:
template<typename... A>
@ -90,8 +88,17 @@ public:
private:
void Format(const MessageFixedText *text, ...);
template<typename A> A Convert(A &x) { return x; }
template<typename A> A Convert(const A &x) {
static_assert(!std::is_class_v<std::decay_t<A>>);
return x;
}
template<typename A> A Convert(A &x) {
static_assert(!std::is_class_v<std::decay_t<A>>);
return x;
}
template<typename A> common::IfNoLvalue<A, A> Convert(A &&x) {
static_assert(!std::is_class_v<std::decay_t<A>>);
return std::move(x);
}
const char *Convert(const std::string &);
@ -100,9 +107,6 @@ private:
const char *Convert(const CharBlock &);
const char *Convert(CharBlock &);
const char *Convert(CharBlock &&);
const char *Convert(const Name &);
const char *Convert(Name &);
const char *Convert(Name &&);
bool isFatal_{false};
std::string string_;

View file

@ -139,7 +139,7 @@ void IoChecker::Enter(const parser::InputItem &spec) {
// This check may be superseded by C928 or C1002.
context_.Say(name.source,
"'%s' must not be a whole assumed size array"_err_en_US,
name); // C1231
name.source); // C1231
}
}
}

View file

@ -75,8 +75,8 @@ private:
// Check that name has been resolved to a symbol
void RewriteMutator::Post(parser::Name &name) {
if (name.symbol == nullptr && errorOnUnresolvedName_) {
messages_.Say(
name.source, "Internal: no symbol found for '%s'"_err_en_US, name);
messages_.Say(name.source, "Internal: no symbol found for '%s'"_err_en_US,
name.source);
}
}