[PATCH] D95168: [clang-format] Add InsertBraces option

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 5 00:28:19 PDT 2021


MyDeveloperDay added a comment.

This will fail in the presence of macro line concatination

  if (x)
          return true;
  else
          return false;
  
  #define RETURN(x) \
  if (x) \
      return true;\
  else \
       return false;

it will remove the trailing \

  if (x) {
    return true;
  } else {
    return false;
  }
  
  #define RETURN(x)                                                              \
    if (x) {                                                                     \
      return true;
  }
  else {
    return false;
  }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95168/new/

https://reviews.llvm.org/D95168



More information about the cfe-commits mailing list