[all-commits] [llvm/llvm-project] 874217: [clang] Enable C++11-style attributes in all langu...

philnik777 via All-commits all-commits at lists.llvm.org
Sat Jul 22 09:34:31 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 874217f99b99ab3c9026dc3b7bd84cd2beebde6e
      https://github.com/llvm/llvm-project/commit/874217f99b99ab3c9026dc3b7bd84cd2beebde6e
  Author: Nikolas Klauser <nikolasklauser at berlin.de>
  Date:   2023-07-22 (Sat, 22 Jul 2023)

  Changed paths:
    M clang/docs/LanguageExtensions.rst
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticParseKinds.td
    M clang/include/clang/Basic/Features.def
    M clang/include/clang/Driver/Options.td
    M clang/include/clang/Parse/Parser.h
    M clang/lib/Basic/Attributes.cpp
    M clang/lib/Lex/Lexer.cpp
    M clang/lib/Parse/ParseDeclCXX.cpp
    M clang/test/AST/ast-dump-attr.m
    M clang/test/AST/ast-dump-c-attr.c
    M clang/test/AST/attr-annotate-type.c
    M clang/test/CodeGen/attr-btf_type_tag-func.c
    M clang/test/CodeGen/attr-btf_type_tag-var.c
    M clang/test/Frontend/noderef.c
    M clang/test/OpenMP/assumes_messages_attr.c
    M clang/test/OpenMP/openmp_attribute_compat.cpp
    M clang/test/Parser/asm.c
    M clang/test/Parser/c2x-attributes.c
    M clang/test/Parser/c2x-attributes.m
    M clang/test/Parser/cxx-decl.cpp
    M clang/test/Parser/objc-attr.m
    M clang/test/ParserHLSL/group_shared.hlsl
    M clang/test/Preprocessor/has_c_attribute.c
    M clang/test/Sema/annotate-type.c
    M clang/test/Sema/annotate.c
    M clang/test/Sema/attr-availability-square-brackets.c
    M clang/test/Sema/attr-external-source-symbol-cxx.cpp
    M clang/test/Sema/attr-external-source-symbol.c
    M clang/test/Sema/attr-likelihood.c
    M clang/test/Sema/attr-objc-bridge-related.m
    M clang/test/Sema/attr-regparm.c
    M clang/test/Sema/attr-type-safety.c
    A clang/test/Sema/c2x-attr.c
    M clang/test/Sema/c2x-noreturn.c
    M clang/test/Sema/internal_linkage.c
    M clang/test/Sema/matrix-type-builtins.c
    M clang/test/Sema/neon-vector-types.c
    M clang/test/Sema/overload-arm-mve.c
    M clang/test/Sema/overloadable.c
    M clang/test/Sema/vector-gcc-compat.c
    R clang/test/SemaCXX/attr-cxx-disabled.cpp
    M clang/test/SemaCXX/cxx98-compat.cpp
    M clang/test/SemaCXX/warn-c++11-extensions.cpp
    M clang/test/SemaObjC/attr-objc-gc.m
    M clang/unittests/AST/AttrTest.cpp
    M clang/utils/TableGen/ClangAttrEmitter.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

  Log Message:
  -----------
  [clang] Enable C++11-style attributes in all language modes

This also ignores and deprecates the `-fdouble-square-bracket-attributes` command line flag, which seems to not be used anywhere. At least a code search exclusively found mentions of it in documentation: https://sourcegraph.com/search?q=context:global+-fdouble-square-bracket-attributes+-file:clang/*+-file:test/Sema/*+-file:test/Parser/*+-file:test/AST/*+-file:test/Preprocessor/*+-file:test/Misc/*+archived:yes&patternType=standard&sm=0&groupBy=repo

RFC: https://discourse.llvm.org/t/rfc-enable-c-11-c2x-attributes-in-all-standard-modes-as-an-extension-and-remove-fdouble-square-bracket-attributes

This enables `[[]]` attributes in all C and C++ language modes without warning by default. `-Wc++-extensions` does warn. GCC has enabled this extension in all C modes since GCC 10.

Reviewed By: aaron.ballman, MaskRay

Spies: #clang-vendors, beanz, JDevlieghere, Michael137, MaskRay, sstefan1, jplehr, cfe-commits, lldb-commits, dmgreen, jdoerfert, wenlei, wlei

Differential Revision: https://reviews.llvm.org/D151683




More information about the All-commits mailing list