<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On May 28, 2011, at 12:50 AM, Chandler Carruth wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Sat, May 28, 2011 at 12:45 AM, Abramo Bagnara<br><<a href="mailto:abramo.bagnara@gmail.com">abramo.bagnara@gmail.com</a>> wrote:<br><blockquote type="cite">This is *very* useful!<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Using similar technique do you think it is feasible to do an helper that<br></blockquote><blockquote type="cite">permit to know if a macro token is at start/end of a macro argument?<br></blockquote><br>Before you start touching macro argument source locations, please look<br>at P9279 and my last patch. I'm working on the final benchmarks to<br>validate that this doesn't cause major performance problems for<br>typical code. Hopefully I'll get that checked in this weekend, but I<br>thought that the last time I rotated around to work on that....<br></div></blockquote><br></div><div><blockquote type="cite"><span class="Apple-style-span" style="font-family: Verdana, sans-serif; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: small; "><pre class="bz_comment_text" id="comment_text_10" style="font-size: medium; font-family: monospace; white-space: pre-wrap; width: 50em; ">% ./new/clang -fsyntax-only t6.cc
t6.cc:5:1: error: expected unqualified-id
M3(1, M0(2), 3);
^
t6.cc:1:15: note: instantiated from:
#define M0(x) x
^
t6.cc:4:27: note: instantiated from:
#define M3(x, y, z) M2(x, y, z)
^
t6.cc:3:27: note: instantiated from:
#define M2(x, y, z) M1(x, y, z)
^
t6.cc:2:21: note: instantiated from:
#define M1(x, y, z) y
^
1 error generated.</pre></span></blockquote><div>That is some serious diagnostic quality improvement, kudos Chandler!</div><div><br></div><div>That said I think we can get the same effect without storing extra source locations, I'll look into it more..</div></div><br></body></html>