<div dir="ltr">The check for MainFileID and accompanying test LGTM.<div><br></div><div>Can you explain what the check for PredefinesFileID is for? AFAICS, there's no test for that part of the change, and I'm concerned that we could end up attributing lines in that FileID to some other file.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 4, 2014 at 3:09 AM, Lubos Lunak <span dir="ltr"><<a href="mailto:l.lunak@centrum.cz" target="_blank">l.lunak@centrum.cz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
 The -frewrite-includes flag incorrectly uses at the beginning a linemarker<br>
for the main file with the "1" flag which suggests that the contents have<br>
been in fact included from another file. This for example<br>
disables -Wunused-macros, which warns only for macros from the main file:<br>
<br>
$ cat a.cpp<br>
#define FOO 1<br>
$ clang++ -E -frewrite-includes a.cpp | clang++ -Wall -Wunused-macros -x<br>
c++ -c -<br>
$ clang++ -Wall -Wunused-macros -c a.cpp<br>
a.cpp:1:9: warning: macro is not used [-Wunused-macros]<br>
#define FOO 1<br>
        ^<br>
1 warning generated.<br>
<br>
 The attached patch fixes the code to start the resulting file with the<br>
correct linemarker.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
 Lubos Lunak<br>
</font></span><br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>