From: Alp Toker Date: Mon, 9 Dec 2013 12:41:02 +0000 (+0000) Subject: Make the -Wkeyword-compat diag message more accurate X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de7d960bbf829b3c543ab59aa3f423880f92411c;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196776 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index 22a9d64ca8..4339fbe8e5 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -59,7 +59,8 @@ def ext_integer_complex : Extension< "complex integer types are a GNU extension">, InGroup; 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; def error_empty_enum : Error<"use of empty enum">; diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 34641722af..63e9235c0d 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -566,7 +566,7 @@ def fmsc_version : Joined<["-"], "fmsc-version=">, Group, Flags<[CC1Opt 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, 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, Flags<[DriverOption, CC1Option]>, MetaVarName<"">, HelpText<"Specify the module cache path">; diff --git a/test/PCH/cxx-traits.h b/test/PCH/cxx-traits.h index 836804ef2c..e6f2feb1d1 100644 --- a/test/PCH/cxx-traits.h +++ b/test/PCH/cxx-traits.h @@ -1,12 +1,12 @@ // Header for PCH test cxx-traits.cpp template -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 -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 }; }; diff --git a/test/Sema/Inputs/ms-keyword-system-header.h b/test/Sema/Inputs/ms-keyword-system-header.h index 43a3db7a12..dda4c2a011 100644 --- a/test/Sema/Inputs/ms-keyword-system-header.h +++ b/test/Sema/Inputs/ms-keyword-system-header.h @@ -3,7 +3,7 @@ typedef union { union w *__uptr; #if defined(MS) && defined(NOT_SYSTEM) - // expected-warning@-2 {{keyword '__uptr' will be treated as an identifier here}} + // expected-warning@-2 {{keyword '__uptr' will be made available as an identifier here}} #endif int *__iptr; } WS __attribute__((__transparent_union__));