]> granicus.if.org Git - clang/commit
Fix handling of comments in macros.
authorManuel Klimek <klimek@google.com>
Wed, 6 Feb 2013 16:40:56 +0000 (16:40 +0000)
committerManuel Klimek <klimek@google.com>
Wed, 6 Feb 2013 16:40:56 +0000 (16:40 +0000)
commitb3507cd01ead99113eed92a815b826f26f6dbadb
tree8bdee5bf2b84d696224b602043d3a41d12d8d43a
parent7fc2db0acd3fb0f38db19764eef137ae3a9edc9f
Fix handling of comments in macros.

We now correctly format:
 // Written as a macro, it is reformatted from:
 #define foo(a)                                                                \
   do {                                                                        \
     /* Initialize num to zero. */                                             \
     int num = 10;                                                             \
     /* This line ensures a is never zero. */                                  \
     int i = a == 0 ? 1 : a;                                                   \
     i = num / i; /* This division is OK. */                                   \
     return i;                                                                 \
   } while (false)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174517 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTest.cpp