https://llvm.org/bugs/show_bug.cgi?id=23657
Bug ID: 23657
Summary: no matching constructor for initialization of 'string'
(aka 'basic_string<char>')
Product: clang
Version: 3.5
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
#include <iostream>
#include <string>
using namespace std;
class Foo {
public:
operator string() const { return n; }
string n {"foo"};
};
int main (int argc, char** argv) {
string s {Foo{}}; // Error
// string s (Foo{}); // Ok
cout << s << endl;
return 0;
}
main.cpp:14:12: error: no matching constructor for initialization of 'string'
(aka 'basic_string<char>')
string s {Foo{}}; // Error
^ ~~~~~~~
I asked about this on stackoverflow (link added below) and someone replied that
it possibly can be a clang bug, so I posted it here. Is this a bug? gcc 4.8.3
compiles it.
http://stackoverflow.com/questions/30461583/no-matching-constructor-for-initialization-of-string-aka-basic-stringchar/30461995#30461995
Thanks
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs