C++11 initializer list

Hello all,
this simple piece of code compiles correctly, but CLion detects an error:

#include <iostream>
#include <vector>

int main() {
    std::vector<int> v{1, 2, 3, 4}; // Here an error is detected
    for(auto& i : v) std::cout << i << std::endl;
    return 0;
}

Error: too many arguments, expected 0

Is initializer list supported by CLion?
2 comments
Comment actions Permalink

Sounds like a bug to me.  Have you made a ticket on the tracker?  

0
Comment actions Permalink

Hi Cristiano.

Thanks for reporting, we have an issue in our tracker already:
https://youtrack.jetbrains.com/issue/CPP-1658
Feel free to comment or upvote.

0

Please sign in to leave a comment.