r196776 - Make the -Wkeyword-compat diag message more accurate

Alp Toker alp at nuanti.com
Mon Dec 9 04:41:03 PST 2013


Author: alp
Date: Mon Dec  9 06:41:02 2013
New Revision: 196776

URL: http://llvm.org/viewvc/llvm-project?rev=196776&view=rev
Log:
Make the -Wkeyword-compat diag message more accurate

Changed from:

  keyword '__is_empty' will be treated as an identifier for the remainder of the translation unit

To:

  keyword '__is_empty' will be made available as an identifier for the remainder of the translation unit

This is a more accurate description of clang's keyword compatibility feature,
given that some of the keywords are turned into context-sensitive keywords
(e.g. REVERTIBLE_TYPE_TRAIT) rather than being fully disabled.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
    cfe/trunk/include/clang/Driver/Options.td
    cfe/trunk/test/PCH/cxx-traits.h
    cfe/trunk/test/Sema/Inputs/ms-keyword-system-header.h

Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=196776&r1=196775&r2=196776&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Mon Dec  9 06:41:02 2013
@@ -59,7 +59,8 @@ def ext_integer_complex : Extension<
   "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>;
 def ext_thread_before : Extension<"'__thread' before '%0'">;
 def ext_keyword_as_ident : ExtWarn<
-  "keyword '%0' will be treated as an identifier %select{here|for the remainder of the translation unit}1">,
+  "keyword '%0' will be made available as an identifier "
+  "%select{here|for the remainder of the translation unit}1">,
   InGroup<KeywordCompat>;
 
 def error_empty_enum : Error<"use of empty enum">;

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=196776&r1=196775&r2=196776&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Mon Dec  9 06:41:02 2013
@@ -566,7 +566,7 @@ def fmsc_version : Joined<["-"], "fmsc-v
   HelpText<"Version of the Microsoft C/C++ compiler to report in _MSC_VER (0 = don't define it (default))">;
 def fdelayed_template_parsing : Flag<["-"], "fdelayed-template-parsing">, Group<f_Group>,
   HelpText<"Parse templated function definitions at the end of the "
-           "translation unit ">,  Flags<[CC1Option]>;
+           "translation unit">,  Flags<[CC1Option]>;
 def fmodules_cache_path : Joined<["-"], "fmodules-cache-path=">, Group<i_Group>,
   Flags<[DriverOption, CC1Option]>, MetaVarName<"<directory>">,
   HelpText<"Specify the module cache path">;

Modified: cfe/trunk/test/PCH/cxx-traits.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/cxx-traits.h?rev=196776&r1=196775&r2=196776&view=diff
==============================================================================
--- cfe/trunk/test/PCH/cxx-traits.h (original)
+++ cfe/trunk/test/PCH/cxx-traits.h Mon Dec  9 06:41:02 2013
@@ -1,12 +1,12 @@
 // Header for PCH test cxx-traits.cpp
 
 template<typename _Tp>
-struct __is_pod { // expected-warning {{keyword '__is_pod' will be treated as an identifier for the remainder of the translation unit}}
+struct __is_pod { // expected-warning {{keyword '__is_pod' will be made available as an identifier for the remainder of the translation unit}}
   enum { __value };
 };
 
 template<typename _Tp>
-struct __is_empty { // expected-warning {{keyword '__is_empty' will be treated as an identifier for the remainder of the translation unit}}
+struct __is_empty { // expected-warning {{keyword '__is_empty' will be made available as an identifier for the remainder of the translation unit}}
   enum { __value };
 };
 

Modified: cfe/trunk/test/Sema/Inputs/ms-keyword-system-header.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/Inputs/ms-keyword-system-header.h?rev=196776&r1=196775&r2=196776&view=diff
==============================================================================
--- cfe/trunk/test/Sema/Inputs/ms-keyword-system-header.h (original)
+++ cfe/trunk/test/Sema/Inputs/ms-keyword-system-header.h Mon Dec  9 06:41:02 2013
@@ -3,7 +3,7 @@
 typedef union {
   union w *__uptr;
 #if defined(MS) && defined(NOT_SYSTEM)
-  // expected-warning at -2 {{keyword '__uptr' will be treated as an identifier here}}
+  // expected-warning at -2 {{keyword '__uptr' will be made available as an identifier here}}
 #endif
   int *__iptr;
 } WS __attribute__((__transparent_union__));





More information about the cfe-commits mailing list