Page 1 of 2

code completion does not work with C++11 after building

Posted: Sat Sep 12, 2015 11:12 am
by litecpp
codelite version: 8.2.0 and 8.2.4
it is not a self compiled version of codelite
OS: windows xp sp3
compiler: mingw64 gcc 5.1.0 and clang 3.6.0

step 1: create a new workspace
step 2: enable c++11 standard
step 3: create a new g++ or clang++ project
step 4: code

Code: Select all

#include <type_traits>

int main()
{
	std::is_void<int>:: // code completion works fine after typing ::
}
step 5: build

step 6:

Code: Select all

#include <type_traits>

int main()
{
	std::is_void<int>:: // code completion does not work.
}
step 7: delete compilation.db, and clear clang cache, then code completion works fine.

step 8: bulid, code completion does not work again.(rebuild workspace, retag workspace has no effect)

step 9: do as step 7. code completion works fine again.

Every time after building I need to delete compilation.db and clear clang cache if I using c++11. How to solve this problem?

Re: code completion does not work with C++11 after building

Posted: Sat Sep 12, 2015 11:57 am
by eranif
works here... I _never_ had to delete compilation.db manually... why are you deleting it?
do you get any errors in the "Clang" tab?

Eran

Re: code completion does not work with C++11 after building

Posted: Sat Sep 12, 2015 12:05 pm
by litecpp

Code: Select all

#include <type_traits>

int main()
{
	std::// clang: use of undeclared identifier 'std'
}

Code: Select all

#include <istream>
#include <type_traits>

int main()
{
	std::// clang: This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
}
If I do not delete compilation.db and clear clang cache, code completion does not work with c++11.

Re: code completion does not work with C++11 after building

Posted: Sat Sep 12, 2015 12:09 pm
by eranif
Where do you enable C++11 from?

Eran

Re: code completion does not work with C++11 after building

Posted: Sat Sep 12, 2015 12:11 pm
by litecpp
workspace settings -> code completion -> enable c++11 standard

Re: code completion does not work with C++11 after building

Posted: Sat Sep 12, 2015 12:16 pm
by eranif
Enable CodeLite logging from: settings->global editor preferences->misc->log
set the log verbosity level to "Debug"

Try to code complete again, when it fails, attach the file codelite.log to your post

Eran

Re: code completion does not work with C++11 after building

Posted: Sat Sep 12, 2015 12:27 pm
by litecpp
see the log

Re: code completion does not work with C++11 after building

Posted: Sat Sep 12, 2015 12:31 pm
by eranif
From the log:

Code: Select all

g++ -std=c++1z -c R:/a/a/a/main.cpp -g -O0 -Wall -o ./Debug/main.cpp.o -I. -I.
Where does the "c++1z" is coming from?

Eran

Re: code completion does not work with C++11 after building

Posted: Sat Sep 12, 2015 12:35 pm
by litecpp
This is new standard, if I change to -std=c++11, the problem is still the same.

Re: code completion does not work with C++11 after building

Posted: Sat Sep 12, 2015 12:38 pm
by eranif
Can you post the log with -std=c++11 ?
Also, you mentioned that you set the c++11 from workspace->settings->code completion->enable c++11 where you dont have control over the input string, so where did you change it to std=c++1z ?

Eran