Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
Qt Creator 4.12.4
-
None
-
MSVC 2015
Description
我认为这应该是语法检查的BUG。
It may be a false alarm of semantic check caused by clang-model.
// code placeholder #include <iostream> using namespace std; int main() { /* *All code can compile and work. */ /*Semantic Issue *main.cpp:12:19: error: no matching constructor for initialization of 'pair<int, int>' *utility:271:5: note: candidate constructor template not viable: requires 3 arguments, but 2 were provided *utility:212:5: note: candidate constructor not viable: requires 1 argument, but 2 were provided *utility:129:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided */ pair<int,int> p1(10,25); pair<int,float> p2(20,50.5f); pair<double,string> p3(2.0e5,"cd"); cout<<p1.first<<" "<<p1.second<<endl;//output is right. cout<<p2.first<<" "<<p2.second<<endl;//output is right. cout<<p3.first<<" "<<p3.second<<endl;//output is right. return 0; }