[PATCH] D25216: Improve error message when referencing a non-tag type with a tag

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 30 16:14:52 PST 2016


rnk added inline comments.


================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:4556-4558
+  "%0 is a %select{non-tag type|typedef|type alias|template|type alias "
+  "template|template template argument}1 that cannot be referenced with a "
+  "%select{struct|interface|union|class|enum}2 tag">;
----------------
rsmith wrote:
> "tag" is C terminology that C++ doesn't share;  "specifier" would be correct in both languages.
> 
> Also, this wording suggests that *some* templates / template template arguments / ... can be referenced by, say, a `struct` specifier. How about:
> 
>   %select{non-struct type|non-class type|non-union type|non-enum type|typedef|type alias|template|[...]}1 %0 cannot be referenced with %select{struct|interface|union|class|enum}2 specifier
> 
> (where we use "non-enum type" when the tag is `enum`, "non-union type" when the tag is `union`, and otherwise use "non-struct type" in C and "non-class type" in C++)?
OK, sounds good.


https://reviews.llvm.org/D25216





More information about the cfe-commits mailing list