Does clang code formatting utilety break defines only on windows?
There is this nice clang plugin for VS that supports code formatting. It
is nice yet it breaks all complex defines:
Say we had:
#include <boost/preprocessor.hpp>
#include <boost/shared_ptr.hpp>
#define NM_PP_VARIADIC_MAX_LENGTH 5
#define NM_PP_TYPE_DECL(z, n, T) \
class BOOST_PP_CAT(T, n )
#define NM_PP_TYPE(z, n, T) \
BOOST_PP_CAT(T, n )
#define NM_PP_ARGUMENT_DECL(z, n, T) \
BOOST_PP_CAT(T, n ) BOOST_PP_CAT(t, n )
This is what we get after formating:
#include <boost/preprocessor.hpp>
#include <boost/shared_ptr.hpp>
#define NM_PP_VARIADIC_MAX_LENGTH 5
#define NM_PP_TYPE_DECL(z, n, T) \
class BOOST_PP_CAT(T, n)
#define NM_PP_TYPE(z, n, T)
BOOST_PP_CAT(T, n)
#define NM_PP_ARGUMENT_DECL(z, n, T)
BOOST_PP_CAT(T, n) BOOST_PP_CAT(t, n)
As you can see such code will not compile and most \ are removed=( Is
there a way to configure it to not remove \?
I tried using default configurations like LLVM and looked at formatting
arguments but I can not see where such cruel code optimization is defined.
No comments:
Post a Comment