https://bugs.llvm.org/show_bug.cgi?id=35425
Bug ID: 35425
Summary: Aggregate initialization of arrays with placement new
when arguments are perfectly forwarded
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: unassignedclangb...@nondot.org
Reporter: ki.s...@gmail.com
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
Hello!
I noticed that I can use aggregate initialization with placement new and
char[10] value, but I cannot do that in a template function if char[10] is
perfectly forwarded.
Unfortunately I cannot refer to the standard and say if it is allowed also.
```
#include <iostream>
#include <utility>
template <typename... Args>
char* foo(Args&&... args) {
static char a[100];
return new (a) char[100] {std::forward<Args>(args)...};
}
int main()
{
std::cout << foo("123456789");
return 0;
}
```
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs