<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Oh. Not if we infer that from .h or .hxx, because then a lot of existing use cases will break. I guess that does call for a new predicate, then.</div><br><div><div>On Jan 17, 2014, at 17:48, Richard Smith <<a href="mailto:metafoo@gmail.com">metafoo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Perhaps isInMainFile should return false if the file type was specified as -x c-header or -x c++-header?<br><br><div>On Fri Jan 17 2014 at 5:42:22 PM, Jordan Rose <<a href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There's not actually any difference between a header file passed as a main file and a normal main file. C doesn't care that one has a .h and/or lives in your include/ folder and that the other has a .c and/or lives in src/ or lib/. I think you've just got to accept that.<br>

<br>
Jordan<br>
<br>
<br>
On Jan 17, 2014, at 16:50, Nikola Smiljanic <<a href="mailto:popizdeh@gmail.com" target="_blank">popizdeh@gmail.com</a>> wrote:<br>
<br>
> Is there a way to know if I'm inside a header file in the Preprocessor class. I've only been able to find warn_using_directive_in_header that does a similar check, only to realize that it's not 100% correct. It uses SourceMgr.isInMainFile which is not right if you pass a header file directly, no warning is generated in that case.<br>

> ______________________________<u></u>_________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-dev</a><br>
<br>
______________________________<u></u>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-dev</a><br>
</blockquote>
</blockquote></div><br></body></html>