Bug 360511 - clang-parser utility doesn't get standard include files
Summary: clang-parser utility doesn't get standard include files
Status: CONFIRMED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: git master
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2016-03-14 09:56 UTC by Pedro Ferreira
Modified: 2016-04-13 07:46 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 :(