Open oxisto opened 5 months ago
Can imagine this could happen in c++17 or newer mode where CDT parser cannot resolve a call from collected function set. What is your c++ version in this case?
Can imagine this could happen in c++17 or newer mode where CDT parser cannot resolve a call from collected function set. What is your c++ version in this case?
Thanks for the quick response... Good question. Personally, we are just using the default settings here, so I am not quite sure which c++ standard we are aiming for (it would actually be interesting for us if we could set this explicitly).
Here are some snippets of how we are using the CDT API (in Kotlin):
val scannerInfo = ScannerInfo(symbols, includePaths.toTypedArray())
val opts = ILanguage.OPTION_PARSE_INACTIVE_CODE
// Set parser language, based on file extension
this.dialect =
if (file.extension == "c") {
GCCLanguage.getDefault()
} else {
GPPLanguage.getDefault()
}
val translationUnit =
this.dialect?.getASTTranslationUnit(
content,
scannerInfo,
includeFileContentProvider,
null,
opts,
log
) as ASTTranslationUnit
It seems to parse, if I explicitly set the compiler to clang instead of GCC, so this could be some incompatibility of macOS std headers with GCC? Not sure if you want to investigate further, at least my problem is solved with a workaround.
Describe the bug
We are using Eclipse CDT to parse C++ code in our static analysis tool. Unfortunately, we get a weird crash when we try to include system headers on macOS. Including a simple header such as
<string>
is enough to make CDT crash.We are using the
getASTTranslationUnit
function of theGPPLanguage
dialect with only theILanguage.OPTION_PARSE_INACTIVE_CODE
option.To Reproduce
Parse a file with the contents
#include <string>
and the include directory set to "/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include/c++/v1/"Expected behavior
No crash
Version Information (please complete the following information):