[all-commits] [llvm/llvm-project] 5824d2: Fix the declaration printer to properly handle pro...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Thu Feb 17 10:54:24 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5824d2bb0f036e631419ae0993fd03d633398266
      https://github.com/llvm/llvm-project/commit/5824d2bb0f036e631419ae0993fd03d633398266
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2022-02-17 (Thu, 17 Feb 2022)

  Changed paths:
    M clang/lib/AST/DeclPrinter.cpp
    M clang/test/Analysis/cfg.c
    M clang/test/Analysis/designated-initializer.c
    M clang/test/Analysis/std-c-library-functions-vs-stream-checker.c
    M clang/test/Analysis/std-c-library-functions.c
    M clang/test/OpenMP/declare_mapper_ast_print.c
    M clang/test/OpenMP/declare_reduction_ast_print.c
    M clang/test/OpenMP/declare_variant_ast_print.c
    M clang/test/OpenMP/metadirective_ast_print.c
    M clang/test/PCH/chain-decls.c
    M clang/test/PCH/chain-macro.c
    M clang/test/Sema/attr-print.c
    M clang/test/SemaObjC/static-ivar-ref-1.m

  Log Message:
  -----------
  Fix the declaration printer to properly handle prototypes in C

Previously, we would take a declaration like void f(void) and print it
as void f(). That's correct in C++ as far as it goes, but is incorrect
in C because that converts the function from having a prototype to one
which does not.

This turns out to matter for some of our tests that use the pretty
printer where we'd like to get rid of the K&R prototypes from the test
but can't because the test is checking the pretty printed function
signature, as done with the ARCMT tests.




More information about the All-commits mailing list