[cfe-commits] r108527 - in /cfe/trunk: include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDecl.cpp test/Parser/MicrosoftExtensions.c

Daniel Dunbar daniel at zuster.org
Sat Jul 17 10:18:27 PDT 2010


Hi Doug,

This breaks GCC compatibility in some places, because we now don't
accept -W[no-]discard-qual. Was that intentional?

 - Daniel

On Fri, Jul 16, 2010 at 8:40 AM, Douglas Gregor <dgregor at apple.com> wrote:
> Author: dgregor
> Date: Fri Jul 16 10:40:40 2010
> New Revision: 108527
>
> URL: http://llvm.org/viewvc/llvm-project?rev=108527&view=rev
> Log:
> Revert Microsoft-specific override of the "typedef requires a name"
> diagnostic. Instead, put it and the "declaration does not declare
> anything" warning into -Wmissing-declarations.
>
> Modified:
>    cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td
>    cfe/trunk/include/clang/Basic/DiagnosticGroups.td
>    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
>    cfe/trunk/lib/Sema/SemaDecl.cpp
>    cfe/trunk/test/Parser/MicrosoftExtensions.c
>
> Modified: cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td?rev=108527&r1=108526&r2=108527&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td (original)
> +++ cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td Fri Jul 16 10:40:40 2010
> @@ -41,7 +41,8 @@
>   "must end with ':'">;
>
>  // Parse && Sema
> -def ext_no_declarators : ExtWarn<"declaration does not declare anything">;
> +def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
> +  InGroup<MissingDeclarations>;
>  def err_param_redefinition : Error<"redefinition of parameter %0">;
>  def err_invalid_storage_class_in_func_decl : Error<
>   "invalid storage class specifier in function declarator">;
>
> Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=108527&r1=108526&r2=108527&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
> +++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Fri Jul 16 10:40:40 2010
> @@ -35,7 +35,7 @@
>  def GNUDesignator : DiagGroup<"gnu-designator">;
>  def Deprecated : DiagGroup<"deprecated">;
>  def : DiagGroup<"disabled-optimization">;
> -def : DiagGroup<"discard-qual">;
> +def : DiagGroup<"discard-qualgnu">;
>  def : DiagGroup<"div-by-zero">;
>  def EmptyBody : DiagGroup<"empty-body">;
>  def ExtraTokens : DiagGroup<"extra-tokens">;
> @@ -57,7 +57,7 @@
>  def LiteralRange : DiagGroup<"literal-range">;
>  def : DiagGroup<"main">;
>  def MissingBraces : DiagGroup<"missing-braces">;
> -def : DiagGroup<"missing-declarations">;
> +def MissingDeclarations: DiagGroup<"missing-declarations">;
>  def : DiagGroup<"missing-format-attribute">;
>  def : DiagGroup<"missing-include-dirs">;
>  def : DiagGroup<"missing-noreturn">;
>
> Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=108527&r1=108526&r2=108527&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
> +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Fri Jul 16 10:40:40 2010
> @@ -227,7 +227,8 @@
>     "platform-specific data}0) must be of type %1">;
>
>  /// parser diagnostics
> -def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">;
> +def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
> +  InGroup<MissingDeclarations>;
>  def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
>  def err_statically_allocated_object : Error<
>   "interface type cannot be statically allocated">;
>
> Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=108527&r1=108526&r2=108527&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Jul 16 10:40:40 2010
> @@ -1550,12 +1550,11 @@
>   if (!DS.isMissingDeclaratorOk() &&
>       DS.getTypeSpecType() != DeclSpec::TST_error) {
>     // Warn about typedefs of enums without names, since this is an
> -    // extension in both Microsoft an GNU.
> +    // extension in both Microsoft and GNU.
>     if (DS.getStorageClassSpec() == DeclSpec::SCS_typedef &&
>         Tag && isa<EnumDecl>(Tag)) {
> -      if (!getLangOptions().Microsoft)
> -        Diag(DS.getSourceRange().getBegin(), diag::ext_typedef_without_a_name)
> -          << DS.getSourceRange();
> +      Diag(DS.getSourceRange().getBegin(), diag::ext_typedef_without_a_name)
> +        << DS.getSourceRange();
>       return DeclPtrTy::make(Tag);
>     }
>
>
> Modified: cfe/trunk/test/Parser/MicrosoftExtensions.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/MicrosoftExtensions.c?rev=108527&r1=108526&r2=108527&view=diff
> ==============================================================================
> --- cfe/trunk/test/Parser/MicrosoftExtensions.c (original)
> +++ cfe/trunk/test/Parser/MicrosoftExtensions.c Fri Jul 16 10:40:40 2010
> @@ -1,4 +1,4 @@
> -// RUN: %clang_cc1 -triple i386-mingw32 -fsyntax-only -verify -fms-extensions -x objective-c++ %s
> +// RUN: %clang_cc1 -triple i386-mingw32 -fsyntax-only -verify -fms-extensions -Wno-missing-declarations -x objective-c++ %s
>  __stdcall int func0();
>  int __stdcall func();
>  typedef int (__cdecl *tptr)();
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>




More information about the cfe-commits mailing list