[all-commits] [llvm/llvm-project] d374b6: Drop qualifiers from return types in C (DR423)

Aaron Ballman via All-commits all-commits at lists.llvm.org
Thu May 19 10:07:18 PDT 2022


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

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaType.cpp
    M clang/test/CodeGen/xcore-stringtype.c
    M clang/test/Sema/block-call.c
    M clang/test/Sema/c89.c
    M clang/test/Sema/function.c
    M clang/test/Sema/warn-missing-prototypes.c
    A clang/test/Sema/wg14-dr423.c
    M clang/test/SemaObjC/block-omitted-return-type.m
    M clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
    M clang/unittests/ASTMatchers/ASTMatchersTest.h

  Log Message:
  -----------
  Drop qualifiers from return types in C (DR423)

WG14 DR423 (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2148.htm#dr_423),
resolved during the C11 time frame, changed the way qualifiers are
handled on function return types and in cast expressions after it was
noted that these types are now directly observable via generic
selection expressions. In C, the function declarator is adjusted to
ignore all qualifiers (including _Atomic qualifiers).

Clang already handles the cast expression case correctly (by performing
the lvalue conversion, which drops the qualifiers as well), but with
these changes it will now also handle function declarations
appropriately.

Fixes #39595

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




More information about the All-commits mailing list