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)
commit82b836a61dc4be6a7b64e9df06dddee62ffe39bc
treeae76be00ea68cbcb751da7636e8b0b2938f462f4
parent85cc9b655d958e9d0b8f47d27f82ea3426c26f5d
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)

llvm-svn: 174517
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTest.cpp