Bug 360511

Summary: clang-parser utility doesn't get standard include files
Product: [Applications] kdevelop Reporter: Pedro Ferreira <arkangath>
Component: Language Support: CPP (Clang-based)Assignee: kdevelop-bugs-null
Status: CONFIRMED ---    
Severity: minor Keywords: junior-jobs
Priority: NOR    
Version: git master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Pedro Ferreira 2016-03-14 09:56:53 UTC
When running the "clang-parser" utility in kdevelop/language/clang/tests, the include directories are not passed in. Thus, #include <utility> for example causes the parser session to stop.

I hacked it by removing the "nostdinc" from parsersession.cpp, in the "empty parser session" conditional block, but this might have undesirable consequences.

Reproducible: Always

Steps to Reproduce:
Write a simple C++ source with "#include <type_traits>" for example.
A clang-parser execution should provide the "file not found" diagnostic.
Comment 1 Kevin Funk 2016-03-14 10:05:26 UTC
Note: You could work-around by doing:
  KDEV_CLANG_EXTRA_ARGUMENTS="-I /foo" clang-parser ...

But we should indeed allow something as easy as:
  clang-parser -clang-parser-arg1 -clang-parser-arg2 -- -clang-arg1 -clang-arg2 myfile.cpp

(Maybe even by simply setting KDEV_CLANG_EXTRA_ARGUMENTS inside clang-parser.cpp. Even better would be proper API inside kdev-clang to set the additional arguments)
Comment 2 Kevin Funk 2016-04-13 07:33:44 UTC
@Pedro: Care to work on a patch?
Comment 3 Pedro Ferreira 2016-04-13 07:46:19 UTC
Oh hi,
Hm, sure I'll dig something up - been a while since I've had time to do any KDev hacking :(