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

General questions regarding the usage of CodeLite
litecpp
CodeLite Enthusiast
Posts: 12
Joined: Fri Sep 04, 2015 12:56 pm
Genuine User: Yes
IDE Question: c++
Contact:

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

Post by litecpp » Sat Sep 12, 2015 11:12 am

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?

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by eranif » Sat Sep 12, 2015 11:57 am

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
Make sure you have read the HOW TO POST thread

litecpp
CodeLite Enthusiast
Posts: 12
Joined: Fri Sep 04, 2015 12:56 pm
Genuine User: Yes
IDE Question: c++
Contact:

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

Post by litecpp » Sat Sep 12, 2015 12:05 pm

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.

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by eranif » Sat Sep 12, 2015 12:09 pm

Where do you enable C++11 from?

Eran
Make sure you have read the HOW TO POST thread

litecpp
CodeLite Enthusiast
Posts: 12
Joined: Fri Sep 04, 2015 12:56 pm
Genuine User: Yes
IDE Question: c++
Contact:

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

Post by litecpp » Sat Sep 12, 2015 12:11 pm

workspace settings -> code completion -> enable c++11 standard

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by eranif » Sat Sep 12, 2015 12:16 pm

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
Make sure you have read the HOW TO POST thread

litecpp
CodeLite Enthusiast
Posts: 12
Joined: Fri Sep 04, 2015 12:56 pm
Genuine User: Yes
IDE Question: c++
Contact:

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

Post by litecpp » Sat Sep 12, 2015 12:27 pm

see the log
You do not have the required permissions to view the files attached to this post.

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by eranif » Sat Sep 12, 2015 12:31 pm

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
Make sure you have read the HOW TO POST thread

litecpp
CodeLite Enthusiast
Posts: 12
Joined: Fri Sep 04, 2015 12:56 pm
Genuine User: Yes
IDE Question: c++
Contact:

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

Post by litecpp » Sat Sep 12, 2015 12:35 pm

This is new standard, if I change to -std=c++11, the problem is still the same.

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by eranif » Sat Sep 12, 2015 12:38 pm

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
Make sure you have read the HOW TO POST thread

Post Reply