http://llvm.org/bugs/show_bug.cgi?id=20874
Bug ID: 20874
Summary: braced initializer lists not properly identified in
variadic templates
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Using trunk clang/llvm/libc++:
#include <memory>
#include <vector>
class A {
public:
A(int i, std::vector<int> v) : i(i), v(v) {
}
private:
int i;
std::vector<int> v;
};
class B {
public:
B(int a, int b) : a(a), b(b) {
}
private:
int a;
int b;
};
int main() {
// This one fails with:
// /usr/local/bin/../include/c++/v1/memory:4628:1: note: candidate function
// not viable: requires single argument '__args', but 2 arguments were
// provided
// make_shared(_Args&& ...__args)
auto a1 = std::make_shared<A>(42, {0, 1});
// This one is okay:
auto a2 = std::shared_ptr<A>(new A(42, {0, 1}));
// Both of these are okay:
auto b1 = std::make_shared<B>(0, 1);
auto b2 = std::shared_ptr<B>(new B(0, 1));
}
--
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