MaskRay / vscode-ccls

ccls plugin for Visual Studio Code
123 stars 37 forks source link

C++14 features gives warnings event though -std=c++14 is used #74

Closed skelutten closed 5 years ago

skelutten commented 5 years ago

Observed behavior

I have -std=c++14 in my settings.json: "ccls.clang.extraArgs": [ "-x c++", "-xc++", "-std=c++14", ..."

But still there are warnings on c++14 features, for example std::make_unique

Expected behavior

C++14 features should be recognized when -std=c++14 is used

Steps to reproduce

System information

/home/$USER/.linuxbrew/Cellar/ccls/0.20190823.3 (5 files, 28.1MB) * Built from source on 2019-10-08 at 14:31:57

joelhock commented 5 years ago

i don't have that exact setup, but

{
    "ccls.clang.extraArgs": [
        "-x c++",
        "-xc++",
        "-std=c++11"
    ]
}

correctly gives: no member named 'make_unique' in namespace 'std'

while

{
    "ccls.clang.extraArgs": [
        "-xc++",
        "-std=c++14"
    ]
}

gives no warning. a .ccls file will trump ccls.clang.extraArgs from my tests--any chance that is happening? you can also set, e.g. "ccls.launch.args": ["-v", "2", "-log-file=/tmp/ccls.log", "-log-file-append"], and look at that file to help figure out any misconfiguration.

joelhock commented 5 years ago

oh yes, i see in #72 you are also trying a .ccls file that might be interfering.