[LLVMbugs] [Bug 20874] New: braced initializer lists not properly identified in variadic templates
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Sep 7 10:04:15 PDT 2014
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: unassignedclangbugs at nondot.org
Reporter: danalbert at google.com
CC: llvmbugs at cs.uiuc.edu
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140907/cf4cfb37/attachment.html>
More information about the llvm-bugs
mailing list