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

Richard Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 30 14:08:31 PST 2016


rsmith 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">;
----------------
"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++)?


https://reviews.llvm.org/D25216





More information about the cfe-commits mailing list