<br><div class="gmail_quote">2011/3/31 Gagan Gupta <span dir="ltr"><<a href="mailto:gagang@cs.wisc.edu">gagang@cs.wisc.edu</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I am using Clang 2.8 and trying to parse C++ code.<br>
Clang is complaining about 4.4.4 cstddef. Error message is included below.<br>
<br>
<br>
In file included from /usr/include/c++/4.4.4/cstdlib:43:<br>
/usr/include/c++/4.4.4/cstddef:48:1: error: C++ requires a type<br>
specifier for all declarations<br>
tutorial7:<br>
/afs/<a href="http://cs.wisc.edu/p/prometheus/private/gagan2/tools/llvm/llvm2.8.source/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp:298" target="_blank">cs.wisc.edu/p/prometheus/private/gagan2/tools/llvm/llvm2.8.source/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp:298</a>:<br>

void<br>
clang::TextDiagnosticPrinter::EmitCaretDiagnostic(clang::SourceLocation,<br>
clang::CharSourceRange*, unsigned int, const clang::SourceManager&,<br>
const clang::FixItHint*, unsigned int, unsigned int, unsigned int,<br>
unsigned int, unsigned int): Assertion `LangOpts && "Unexpected<br>
diagnostic outside source file processing"' failed.<br>
Stack dump:<br>
0.      /usr/include/c++/4.4.4/cstddef:48:25: current parser token '('<br>
<br>
<br>
I would greatly appreciate any help with resolving the problem.<br>
Thanks,<br>
Gagan<br> </blockquote><div>It sounds like you are using the gcc-headers, which causes troubles within clang. </div><div>Try using clangs own headers by passing the "-resources <path>"-parameter to clang.</div>
<div>To see the correct resources-path, take your cpp-file and call</div><div>clang -### <yourcppfile></div><div>on it - you will see the default arguments that clang would use to compile the file, the</div><div>resources-parameter should also be included.</div>
</div><br>