Skip to content

[clang-format] Regression in clang-format version 17 #72785

Closed
llvm/llvm-project-release-prs
#781
@prj-

Description

@prj-
$ cat regression.c 
#if defined(PETSC_HAVE_CUDA) || defined(PETSC_HAVE_KOKKOS) || defined(PETSC_HAVE_HIP)
  /* Free memory and set ptr to NULL when succeeded */
  #define PetscSFFree(sf, mtype, ptr) ((PetscErrorCode)((ptr) && ((*(sf)->ops->Free)(mtype, ptr) || ((ptr) = NULL, PETSC_SUCCESS))))
#else
  /* If pure host code, do with less indirection */
  #define PetscSFMalloc(sf, mtype, sz, ptr) PetscMalloc(sz, ptr)
#endif
$ clang-format --style=file:clang-format.txt regression.c
#if defined(PETSC_HAVE_CUDA) || defined(PETSC_HAVE_KOKKOS) || defined(PETSC_HAVE_HIP)
  /* Free memory and set ptr to NULL when succeeded */
  #define PetscSFFree(sf, mtype, ptr) ((PetscErrorCode)((ptr) && ((*(sf)->ops->Free)(mtype, ptr) || ((ptr) = NULL, PETSC_SUCCESS))))
#else
/* If pure host code, do with less indirection */
  #define PetscSFMalloc(sf, mtype, sz, ptr) PetscMalloc(sz, ptr)
#endif
$ clang-format --version
clang-format version 17.0.5

clang-format.txt

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions