Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

std::thread Parameter type mismatch: Expression must be rvalue

Tags:

clion

I have CLion 1.2 on Mint Maya with installed gcc5. Default gcc is 4.6. (/usr/bin/gcc -> gcc-4.6) Compiler set through CMakeLists and Settings
[toolchain settings] https://www.dropbox.com/s/se5nxfdki7zdkhm/screen_settings_toolchain.png [sample] https://www.dropbox.com/s/ss7r6kss64k00ez/screen.png

Editor say: Parameter type mismatch: Expression must be rvalue on std::thread t1(f1) but I can build and run this sample

What is wrong?

Sample:

void f1(){
cout<<"hi"<<endl;
}
int main() {
cout << "Hello, World!" << endl;
std::thread t1(f1);//Parameter type mismatch: Expression must be rvalue
t1.join();
return 0;
}
like image 997
newbieInCLion Avatar asked Feb 20 '16 12:02

newbieInCLion


1 Answers

I believe it's a parser bug of clion

UPDATE

Affected versions: CLion 1.2

Fix versions: CLion 2016.1

like image 126
Manatax Avatar answered Nov 07 '22 22:11

Manatax