mardi 1 mars 2022

std::promise not emit unused warning [duplicate]

#include <upstream>
#include <future>

void test() {
    std::promise<int> m;
     int a;
}
int main(){
    test();
    return 0;
}

g++-5.4.0 —std=c++11 Wall test.cpp -o myexpect

however, a will emit a unused variable warning, m does not? is this compiler a bug?

Aucun commentaire:

Enregistrer un commentaire