"No matching constructor" but still compiles

已回答

CLion is underlining my code, stating that it does not find the right constructor. However, the MinGW toolchain is still able to compile it (Windows).

Restarting CLion does not make the red underline or error go away.

 

Here is a (fairly) minimal example (with the error line highlighted):

https://gist.github.com/JochemKuijpers/890118e9749072c75b22b3864a870c7f#file-main-cpp-L4

 

It seems CLion is looking for a std::initialization_list constructor, while I provided a constructor that takes a constant array reference.

1

Hi, Jochem! Thanks for reporting. I've created the issue in our tracker: https://youtrack.jetbrains.com/issue/CPP-12126. Follow it to get updates.

0

请先登录再写评论。