[cfe-dev] Clang 2.8 problems with 4.4.4. cstddef

Hendrik vP variadic.template at googlemail.com
Fri Apr 1 03:53:25 PDT 2011


2011/3/31 Gagan Gupta <gagang at cs.wisc.edu>

> I am using Clang 2.8 and trying to parse C++ code.
> Clang is complaining about 4.4.4 cstddef. Error message is included below.
>
>
> In file included from /usr/include/c++/4.4.4/cstdlib:43:
> /usr/include/c++/4.4.4/cstddef:48:1: error: C++ requires a type
> specifier for all declarations
> tutorial7:
> /afs/
> cs.wisc.edu/p/prometheus/private/gagan2/tools/llvm/llvm2.8.source/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp:298
> :
> void
> clang::TextDiagnosticPrinter::EmitCaretDiagnostic(clang::SourceLocation,
> clang::CharSourceRange*, unsigned int, const clang::SourceManager&,
> const clang::FixItHint*, unsigned int, unsigned int, unsigned int,
> unsigned int, unsigned int): Assertion `LangOpts && "Unexpected
> diagnostic outside source file processing"' failed.
> Stack dump:
> 0.      /usr/include/c++/4.4.4/cstddef:48:25: current parser token '('
>
>
> I would greatly appreciate any help with resolving the problem.
> Thanks,
> Gagan
>

It sounds like you are using the gcc-headers, which causes troubles within
clang.
Try using clangs own headers by passing the "-resources <path>"-parameter to
clang.
To see the correct resources-path, take your cpp-file and call
clang -### <yourcppfile>
on it - you will see the default arguments that clang would use to compile
the file, the
resources-parameter should also be included.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110401/4aa67fb6/attachment.html>


More information about the cfe-dev mailing list