[PATCH] D54565: Introduce `-Wc++14-compat-ctad` as a subgroup of `-Wc++14-compat`

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 14 19:39:02 PST 2018


Quuxplusone created this revision.
Quuxplusone added a reviewer: rsmith.
Herald added a subscriber: cfe-commits.

Since I am interested in diagnosing this specific C++17ism (but not necessarily other C++17isms) in our codebase going forward.
I //think// I got the naming convention right! Personally I see this as similar in spirit to `-Wvla` and would like to name it simply `-Wctad`, but the longer name seems like a less controversial choice, and accomplishes my goal of having a fine-grained diagnostic by whatever name.


Repository:
  rC Clang

https://reviews.llvm.org/D54565

Files:
  include/clang/Basic/DiagnosticGroups.td
  include/clang/Basic/DiagnosticSemaKinds.td


Index: include/clang/Basic/DiagnosticSemaKinds.td
===================================================================
--- include/clang/Basic/DiagnosticSemaKinds.td
+++ include/clang/Basic/DiagnosticSemaKinds.td
@@ -2164,7 +2164,7 @@
 def warn_cxx14_compat_class_template_argument_deduction : Warning<
   "class template argument deduction is incompatible with C++ standards "
   "before C++17%select{|; for compatibility, use explicit type name %1}0">,
-  InGroup<CXXPre17Compat>, DefaultIgnore;
+  InGroup<CTAD>, DefaultIgnore;
 
 // C++14 deduced return types
 def err_auto_fn_deduction_failure : Error<
Index: include/clang/Basic/DiagnosticGroups.td
===================================================================
--- include/clang/Basic/DiagnosticGroups.td
+++ include/clang/Basic/DiagnosticGroups.td
@@ -50,6 +50,7 @@
 def Coroutine : DiagGroup<"coroutine", [CoroutineMissingUnhandledException]>;
 def ConstantConversion :
   DiagGroup<"constant-conversion", [ BitFieldConstantConversion ] >;
+def CTAD : DiagGroup<"ctad">;
 def LiteralConversion : DiagGroup<"literal-conversion">;
 def StringConversion : DiagGroup<"string-conversion">;
 def SignConversion : DiagGroup<"sign-conversion">;
@@ -183,7 +184,8 @@
 def CXXPre14CompatPedantic : DiagGroup<"c++98-c++11-compat-pedantic",
                                        [CXXPre14Compat,
                                         CXXPre14CompatBinaryLiteral]>;
-def CXXPre17Compat : DiagGroup<"c++98-c++11-c++14-compat">;
+def CXXPre17Compat : DiagGroup<"c++98-c++11-c++14-compat",
+                                       [CTAD]>;
 def CXXPre17CompatPedantic : DiagGroup<"c++98-c++11-c++14-compat-pedantic",
                                        [CXXPre17Compat]>;
 def CXXPre2aCompat : DiagGroup<"c++98-c++11-c++14-c++17-compat">;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54565.174149.patch
Type: text/x-patch
Size: 1793 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181115/62f819ac/attachment.bin>


More information about the cfe-commits mailing list