gcc/d/ChangeLog:
* d/d-builtins.cc (d_init_builtins): Quote keywords, operators,
and types in diagnostics.
* d/d-codegen.cc (get_array_length): Same. Replace can't with cannot.
* d/d-convert.cc (convert_expr): Same.
* d/d-frontend.cc (getTypeInfoType): Quote an option name in
a diagnostic.
* d/d-lang.cc (d_handle_option): Same.
(d_parse_file): Same.
* d/decl.cc: Remove a trailing period from a diagnostic.
* d/expr.cc: Use a directive for an apostrophe.
* d/toir.cc: Quote keywords, operators, and types in diagnostics.
* d/typeinfo.cc (build_typeinfo): Quote an option name in a diagnostic.
@@ -1117,7 +1117,7 @@ d_init_builtins (void)
Type::tvalist = build_frontend_type (va_list_type_node);
if (!Type::tvalist)
{
- error ("cannot represent built-in va_list type in D");
+ error ("cannot represent built-in %<va_list%> type in D");
gcc_unreachable ();
}
@@ -316,7 +316,7 @@ get_array_length (tree exp, Type *type)
return d_array_length (exp);
default:
- error ("can't determine the length of a %qs", type->toChars ());
+ error ("cannot determine the length of a %qs", type->toChars ());
return error_mark_node;
}
}
@@ -376,7 +376,7 @@ convert_expr (tree exp, Type *etype, Type *totype)
}
else
{
- error ("can't convert a delegate expression to %qs",
+ error ("cannot convert a delegate expression to %qs",
totype->toChars ());
return error_mark_node;
}
@@ -392,7 +392,7 @@ convert_expr (tree exp, Type *etype, Type *totype)
}
else
{
- error ("can't convert struct %qs to %qs",
+ error ("cannot convert struct %qs to %qs",
etype->toChars (), totype->toChars ());
return error_mark_node;
}
@@ -475,7 +475,7 @@ convert_expr (tree exp, Type *etype, Type *totype)
if ((dim * esize) % tsize != 0)
{
- error ("cannot cast %qs to %qs since sizes don't line up",
+ error ("cannot cast %qs to %qs since sizes do not line up",
etype->toChars (), totype->toChars ());
return error_mark_node;
}
@@ -625,7 +625,7 @@ getTypeInfoType (Loc loc, Type *type, Scope *sc)
if (!warned)
{
error_at (make_location_t (loc),
- "%<object.TypeInfo%> cannot be used with -fno-rtti");
+ "%<object.TypeInfo%> cannot be used with %<-fno-rtti%>");
warned = 1;
}
}
@@ -449,7 +449,7 @@ d_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
break;
}
- error ("bad argument for -fdebug %qs", arg);
+ error ("bad argument for %<-fdebug%>: %qs", arg);
break;
case OPT_fdoc:
@@ -497,7 +497,7 @@ d_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
case OPT_fmodule_file_:
global.params.modFileAliasStrings->push (arg);
if (!strchr (arg, '='))
- error ("bad argument for -fmodule-file %qs", arg);
+ error ("bad argument for %<-fmodule-file%>: %qs", arg);
break;
case OPT_fmoduleinfo:
@@ -588,7 +588,7 @@ d_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
break;
}
- error ("bad argument for -fversion %qs", arg);
+ error ("bad argument for %<-fversion%>: %qs", arg);
break;
case OPT_H:
@@ -1011,7 +1011,7 @@ d_parse_file (void)
/* In this mode, the first file name is supposed to be a duplicate
of one of the input files. */
if (d_option.fonly && strcmp (d_option.fonly, main_input_filename) != 0)
- error ("-fonly= argument is different from first input file name");
+ error ("%<-fonly=%> argument is different from first input file name");
for (size_t i = 0; i < num_in_fnames; i++)
{
@@ -463,7 +463,7 @@ public:
fd2->toPrettyChars ());
inform (make_location_t (d->loc),
"use %<alias %s = %s.%s;%> to introduce base class "
- "overload set.", fd->toChars (),
+ "overload set", fd->toChars (),
fd->parent->toChars (), fd->toChars ());
}
else
@@ -1522,7 +1522,7 @@ public:
}
else
{
- error ("don't know how to delete %qs", e->e1->toChars ());
+ error ("don%'t know how to delete %qs", e->e1->toChars ());
this->result_ = error_mark_node;
}
}
@@ -367,9 +367,11 @@ public:
}
if (ent->in_try_scope)
- error_at (make_location_t (from->loc), "cannot goto into try block");
+ error_at (make_location_t (from->loc),
+ "cannot %<goto%> into %<try%> block");
else if (ent->in_catch_scope)
- error_at (make_location_t (from->loc), "cannot goto into catch block");
+ error_at (make_location_t (from->loc),
+ "cannot %<goto%> into %<catch%> block");
}
/* Check that a previously seen jump to a newly defined label is valid.
@@ -391,21 +393,21 @@ public:
{
location = make_location_t (fwdref->statement->loc);
if (b->kind == level_try)
- error_at (location, "cannot goto into try block");
+ error_at (location, "cannot %<goto%> into %<try%> block");
else
- error_at (location, "cannot goto into catch block");
+ error_at (location, "cannot %<goto%> into %<catch%> block");
}
else if (s->isCaseStatement ())
{
location = make_location_t (s->loc);
error_at (location, "case cannot be in different "
- "try block level from switch");
+ "%<try%> block level from %<switch%>");
}
else if (s->isDefaultStatement ())
{
location = make_location_t (s->loc);
error_at (location, "default cannot be in different "
- "try block level from switch");
+ "%<try%> block level from %<switch%>");
}
else
gcc_unreachable ();
@@ -1125,8 +1127,8 @@ public:
static int warned = 0;
if (!warned)
{
- error_at (make_location_t (s->loc), "exception handling disabled, "
- "use -fexceptions to enable");
+ error_at (make_location_t (s->loc), "exception handling disabled; "
+ "use %<-fexceptions%> to enable");
warned = 1;
}
}
@@ -1350,7 +1350,7 @@ build_typeinfo (const Loc &loc, Type *type)
if (!warned)
{
error_at (make_location_t (loc),
- "%<object.TypeInfo%> cannot be used with -fno-rtti");
+ "%<object.TypeInfo%> cannot be used with %<-fno-rtti%>");
warned = 1;
}
}