[cfe-commits] PATCH: Fix PR8767, improve diagnostic wording when allocating an object of an abstract class type
Douglas Gregor
dgregor at apple.com
Fri Feb 18 07:10:38 PST 2011
On Feb 18, 2011, at 12:52 AM, Chandler Carruth wrote:
> What it says on the tin. Patch authored by Stephen Hines.
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index 7b28463..e92b101 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -500,7 +500,7 @@ def err_partial_specialization_friend : Error<
def err_abstract_type_in_decl : Error<
"%select{return|parameter|variable|field}0 type %1 is an abstract class">;
def err_allocation_of_abstract_type : Error<
- "allocation of an object of abstract type %0">;
+ "allocating an object of type %0, which is an abstract class">;
def err_throw_abstract_type : Error<
"cannot throw an object of abstract type %0">;
def err_array_of_abstract_type : Error<"array of abstract class type %0">;
Personally, I like "abstract class type %0" better than "type %0, which is an abstract class". The latter just sounds wordy. Switching from "allocation of" to "allocating" is fine, and the other change is definitely clearer.
- Doug
More information about the cfe-commits
mailing list