<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJzdWFFz2jgQ_jXmRRMGDAR44IEE0mYmd9dJ05m-MbK9BjXG8khyaO7X37cyNiYhadrk6TIEbEva_Xa1-2nXkU4eZ9dBON6KNTmn8rWQuShz-llQ7CgRlpzQqSBjtLEiNXor3IZEYagwOiZrtQnCS7HbqHgjrjGm8nvBAh9IOCNjiEj0LhdOi9J68SLix2cqV07JTP1LRugcjxPppFCOtiKhOJMGK1VuVUIY28rY6K64dsBDWysydU-YKzbSsuSI56S0Exk9UGYhgAosFtokkI4Jzqj1mi8BPSrXjFjmiZCZ1bWMjQTirTaAvYELdE6CMtpS7liSX-hxZ8q6rqhN3GlzD6DS6BLygCh6FDHWr9nUZpFXUMCk3Hq9CaUw3zsj1rl1poxd5ceodH7Z3t-Z1vfsa-ceBaZBLnWD3iLozT-TIUCwfrbVpYkpGMyrseC8t__420o-1kun4pX3cDC-qMZEBYAxGxGE81RlkNMMRlpngn5SXCIWWs9bsoJwckIEm3K0NpzWa4UAUFHNmlQ_U55_mDpprfJQx4u9YbioQey_w4FK4U5xebOc_9088w4m8elu-fVutVhe3sxvlysRjC6PDTjySTWZLzEznIjV6ur6ZrlaMbYUkUKCgTbqwwEijT5O4_jilMa2wdCYJyp9Yv4TxfO7zyt_CRNYl49g78cDFJWygYgK2jtYHGYOLsTB3U90zL9-Xd7erZbfr-9ekf4rJKdlL79_WV7ere5uvy2riEpADzo_ifx4FPCfev3YgAetErFQZP9iFlmQdBsIqWNrL_nYNhZ6jGjvrdo_7UhotB2n3aXeFirjLN8ptxF4fraoovS8JxS4FGZ76sSo9mkvHTMIeBhZvdM1B4CeUp1leme7J_UEY-C7Ahv_AGNbXN5-gglXi-XFt0_VNgThEG4b3tx8-4IBcCswnYEUCUwWF0VXi7O4uROV1PoWuRqe46s_5qz1kPjCaQ1Szh_BfOuSN9aCpvQD2DphrkvLPOYNOvNE7dkbLPqgY-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th>Summary</th>
        <td>
            Preprocessor error on nested macro with brace-initializer
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          pogo59
      </td>
    </tr>
</table>

<pre>
    I'm getting an unexpected set of errors from the preprocessor, which I think I've traced down to using a brace-initializer on a data item declared inside a macro. It seems like it has to be a few levels deep in order to trigger the bug, and also has to have more than one element in the brace-list.  I've worked around it by changing the braces to parens and defining a constructor, but the errors look pretty strange.
Here's the source:
```
struct static_item {
  const char *file;
  bool executed;
  static_item(const char *file, bool executed)
    : file(file), executed(executed) {}
};

#ifdef CLEAN
#define GTEST_DECLARE_ \
  static static_item GTEST_item_ ( __FILE__, false );
#else
#define GTEST_DECLARE_ \
  static static_item GTEST_item_ { __FILE__, false };
#endif

#define GTEST_DEATH_TEST_(statement) \
  if (true) { statement; }

#define ASSERT_EXIT(statement) \
  GTEST_DEATH_TEST_(statement)

#define EXPECT_TRUE(condition) \
  if (condition) { GTEST_DECLARE_ }

void DiesMacroDeath() {
  ASSERT_EXIT({ EXPECT_TRUE(true); });
}
```
Compiling with `-DCLEAN` is fine, without that it gets two errors as follows.
```
~/projects/RGT/DEBUG_DEATH$ $LLUP/clang -o test.cpp.o -c test.cpp 
test.cpp:26:17: error: too many arguments provided to function-like macro invocation
  ASSERT_EXIT({ EXPECT_TRUE(true); });
                ^
test.cpp:23:20: note: expanded from macro 'EXPECT_TRUE'
  if (condition) { GTEST_DECLARE_ }
                   ^
test.cpp:13:46: note: expanded from macro 'GTEST_DECLARE_'
  static static_item GTEST_item_ { __FILE__, false };
                                             ^
test.cpp:16:9: note: macro 'GTEST_DEATH_TEST_' defined here
#define GTEST_DEATH_TEST_(statement) \
        ^
test.cpp:26:3: note: cannot use initializer list at the beginning of a macro argument
  ASSERT_EXIT({ EXPECT_TRUE(true); });
  ^
test.cpp:20:3: note: expanded from macro 'ASSERT_EXIT'
  GTEST_DEATH_TEST_(statement)
  ^
test.cpp:26:3: error: use of undeclared identifier 'GTEST_DEATH_TEST_'
  ASSERT_EXIT({ EXPECT_TRUE(true); });
  ^
test.cpp:20:3: note: expanded from macro 'ASSERT_EXIT'
  GTEST_DEATH_TEST_(statement)
  ^
2 errors generated.
```
Observe the "note: macro 'GTEST_DEATH_TEST_' defined here" followed by "error: use of undeclared identifer 'GTEST_DEATH_TEST_'" which seems pretty confused.
Also "cannot use initializer list at the beginning of a macro argument" is just not the problem, the initializer list is nowhere near the beginning of any macro argument.  I suspect that note comes up because the argument is a brace-enclosed block?

gcc is less verbose but also has the same problem:
```
~/projects/RGT/DEBUG_DEATH$ gcc -c test.cpp
test.cpp:26:37: error: macro "GTEST_DEATH_TEST_" passed 2 arguments, but takes just 1
   ASSERT_EXIT({ EXPECT_TRUE(true); });
                                     ^
test.cpp: In function ‘void DiesMacroDeath()’:
test.cpp:20:3: error: ‘GTEST_DEATH_TEST_’ was not declared in this scope
   GTEST_DEATH_TEST_(statement)
   ^
test.cpp:26:3: note: in expansion of macro ‘ASSERT_EXIT’
   ASSERT_EXIT({ EXPECT_TRUE(true); });
   ^~~~~~~~~~~
```
which does make me wonder if I'm tripping over some especially obscure bit of defined preprocessor behavior.  It would have to involve the commas inside the braces being interpreted differently than the commas inside the parens, somehow, and really it seems like that shouldn't happen.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzdWE1z4jgQ_TXmogoFNgQ4cCCBzKQquzuVyVTNjZJtGTQxkkuSw2R__b6WPzAJyWQmOW2KgG21ul-3Wk_djnX6OL8OwsmObYRzUm0YV6xU4mchEidSZoVjOmPCGG0sy4zeMbcVrDCiMDoR1moThJdsv5XJll1jTKp7RgofBHOGJ1CR6r1iTrPSevUspsdnUkkneS7_FYZphccpd5xJJ3YsFUnODWZKZWUqMLbjidF9du2AR-wsy-W9gCzbckuaY5LJxJ7l4kHkFgpEgclMmxTaIeCM3GzoEtDjckOIuUoZ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