[all-commits] [llvm/llvm-project] 2cb2cd: Change the behavior of implicit int diagnostics

Aaron Ballman via All-commits all-commits at lists.llvm.org
Wed May 4 05:36:09 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2cb2cd242ca08d0bbd2a51a41f1317442e5414fc
      https://github.com/llvm/llvm-project/commit/2cb2cd242ca08d0bbd2a51a41f1317442e5414fc
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2022-05-04 (Wed, 04 May 2022)

  Changed paths:
    M clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
    M clang-tools-extra/test/clang-tidy/checkers/altera-struct-pack-align-invalid-decl-no-crash.cpp
    M clang-tools-extra/test/clang-tidy/infrastructure/export-diagnostics.cpp
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticCommonKinds.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Basic/LangOptions.def
    M clang/include/clang/Basic/LangOptions.h
    M clang/include/clang/Basic/LangStandard.h
    M clang/include/clang/Basic/LangStandards.def
    M clang/lib/Basic/LangOptions.cpp
    M clang/lib/Parse/ParseDecl.cpp
    M clang/lib/Parse/Parser.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaType.cpp
    M clang/test/Analysis/PR49642.c
    M clang/test/Analysis/inline-unique-reports.c
    M clang/test/Analysis/malloc.c
    M clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp
    M clang/test/CXX/drs/dr2xx.cpp
    M clang/test/CXX/drs/dr4xx.cpp
    M clang/test/CXX/drs/dr5xx.cpp
    M clang/test/CXX/modules-ts/basic/basic.link/module-declaration.cpp
    M clang/test/CXX/temp/p3.cpp
    M clang/test/CXX/temp/temp.deduct.guide/p3.cpp
    M clang/test/CXX/temp/temp.res/temp.local/p3.cpp
    M clang/test/CodeGen/2002-07-14-MiscTests2.c
    M clang/test/CodeGen/2003-08-20-vfork-bug.c
    M clang/test/CodeGen/2007-04-24-bit-not-expr.c
    M clang/test/CodeGen/2007-09-26-Alignment.c
    M clang/test/CodeGen/2010-07-14-ref-off-end.c
    M clang/test/CodeGen/mips-clobber-reg.c
    M clang/test/CodeGen/mips-vector-arg.c
    M clang/test/Driver/cxx_for_opencl.clcpp
    M clang/test/FixIt/fixit.c
    M clang/test/Frontend/fixed_point_errors.c
    M clang/test/Frontend/fixed_point_not_enabled.c
    M clang/test/Frontend/system-header-line-directive.c
    M clang/test/Index/reparsed-live-issue.cpp
    M clang/test/Misc/warning-flags.c
    M clang/test/Modules/malformed-overload.m
    M clang/test/Modules/va_list.m
    M clang/test/PCH/decl-in-prototype.c
    M clang/test/Parser/altivec.c
    M clang/test/Parser/attributes.c
    M clang/test/Parser/backtrack-off-by-one.cpp
    M clang/test/Parser/c2x-attributes.c
    M clang/test/Parser/c2x-func-prototype.c
    M clang/test/Parser/colon-colon-parentheses.cpp
    M clang/test/Parser/cxx-altivec.cpp
    M clang/test/Parser/cxx-concepts-ambig-constraint-expr.cpp
    M clang/test/Parser/cxx-decl.cpp
    M clang/test/Parser/cxx-keyword-identifiers.cpp
    M clang/test/Parser/cxx-template-decl.cpp
    M clang/test/Parser/cxx-undeclared-identifier.cpp
    M clang/test/Parser/cxx2b-lambdas.cpp
    M clang/test/Parser/declarators.c
    M clang/test/Parser/explicit-bool.cpp
    M clang/test/Parser/ext-int.cpp
    M clang/test/Parser/objc-forcollection-neg-2.m
    M clang/test/Parser/static_assert.c
    M clang/test/Preprocessor/macro_paste_msextensions.c
    M clang/test/Sema/address_spaces.c
    M clang/test/Sema/auto-type.c
    M clang/test/Sema/block-args.c
    M clang/test/Sema/block-literal.c
    M clang/test/Sema/c89.c
    M clang/test/Sema/crash-invalid-builtin.c
    M clang/test/Sema/darwin-tls.c
    M clang/test/Sema/function.c
    M clang/test/Sema/implicit-int.c
    M clang/test/Sema/invalid-decl.c
    M clang/test/Sema/invalid-struct-init.c
    M clang/test/Sema/redefinition.c
    M clang/test/Sema/return.c
    M clang/test/Sema/typo-correction.c
    M clang/test/Sema/warn-strict-prototypes.c
    M clang/test/SemaCXX/MicrosoftSuper.cpp
    M clang/test/SemaCXX/PR9459.cpp
    M clang/test/SemaCXX/PR9460.cpp
    M clang/test/SemaCXX/PR9461.cpp
    M clang/test/SemaCXX/crashes.cpp
    M clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp
    M clang/test/SemaCXX/for-range-crash.cpp
    M clang/test/SemaCXX/implicit-int.cpp
    M clang/test/SemaCXX/lambda-invalid-capture.cpp
    M clang/test/SemaCXX/pr18284-crash-on-invalid.cpp
    M clang/test/SemaCXX/typo-correction-delayed.cpp
    M clang/test/SemaCXX/typo-correction.cpp
    M clang/test/SemaCXX/unknown-type-name.cpp
    M clang/test/SemaObjC/protocols.m
    M clang/test/SemaObjCXX/crash.mm
    M clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl
    M clang/test/SemaTemplate/address_space-dependent.cpp
    M clang/test/SemaTemplate/derived.cpp
    M clang/test/SemaTemplate/temp_arg_template.cpp
    M clang/test/Tooling/auto-detect-from-source-parent-of-cwd.cpp
    M clang/test/Tooling/auto-detect-from-source-parent.cpp
    M clang/test/Tooling/clang-check-args.cpp
    M clang/test/Tooling/clang-check-autodetect-dir.cpp
    M clang/test/Tooling/clang-check-builtin-headers.cpp
    M clang/test/Tooling/clang-check-chdir.cpp
    M clang/test/Tooling/clang-check-pwd.cpp
    M clang/test/Tooling/clang-check-rel-path.cpp
    M clang/test/Tooling/clang-check-strip-o.cpp
    M clang/test/Tooling/clang-check.cpp
    M clang/test/Tooling/multi-jobs.cpp
    M clang/unittests/AST/SourceLocationTest.cpp

  Log Message:
  -----------
  Change the behavior of implicit int diagnostics

C89 allowed a type specifier to be elided with the resulting type being
int, aka implicit int behavior. This feature was subsequently removed
in C99 without a deprecation period, so implementations continued to
support the feature. Now, as with implicit function declarations, is a
good time to reevaluate the need for this support.

This patch allows -Wimplicit-int to issue warnings in C89 mode (off by
default), defaults the warning to an error in C99 through C17, and
disables support for the feature entirely in C2x. It also removes a
warning about missing declaration specifiers that really was just an
implicit int warning in disguise and other minor related cleanups.




More information about the All-commits mailing list