Issue 142229
Summary [clang-format] Ignore preprocessor directives during header groups analysis
Labels clang-format
Assignees
Reporter EugeneZelenko
    Sometimes compiler warnings must be disabled in third-party code, but related preprocessor directives are considered by Clang-Format as header group boundary what makes Clang-Format unable to find main header (included after third-party headers).

Code snippet:

```
#include <Python.h>
#ifdef __GNUC__
#   pragma GCC diagnostic push
#   pragma GCC diagnostic ignored "-Wpedantic"
#   pragma GCC diagnostic ignored "-Wshadow"
#   pragma GCC diagnostic ignored "-Wsuggest-override"
#endif
#define BOOST_NO_AUTO_PTR
#include <boost/python/import.hpp>
#include <boost/python/object.hpp>
#ifdef __GNUC__
#   pragma GCC diagnostic pop
#endif
# include "application_header1.h"
...
# include "application_headerN.h"
```

I tried 19.1.1 and `main` (49d48c32e04742ebd05cbbd7dd544b1217b6d9d0)
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to