2011-10-14 06:29:44 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
|
2011-09-23 07:04:35 +08:00
|
|
|
|
|
|
|
namespace PR10457 {
|
|
|
|
|
|
|
|
class string
|
|
|
|
{
|
|
|
|
string(const char* str, unsigned);
|
|
|
|
|
|
|
|
public:
|
|
|
|
template <unsigned N>
|
|
|
|
string(const char (&str)[N])
|
|
|
|
: string(str) {} // expected-error{{constructor for 'string<6>' creates a delegation cycle}}
|
|
|
|
};
|
|
|
|
|
|
|
|
void f() {
|
|
|
|
string s("hello");
|
|
|
|
}
|
2011-11-01 09:16:03 +08:00
|
|
|
|
|
|
|
struct Foo {
|
|
|
|
Foo(int) { }
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
Foo(T, int i) : Foo(i) { }
|
|
|
|
};
|
|
|
|
|
|
|
|
void test_Foo()
|
|
|
|
{
|
|
|
|
Foo f(1, 1);
|
|
|
|
}
|
2011-09-23 07:04:35 +08:00
|
|
|
}
|
2012-05-20 07:35:23 +08:00
|
|
|
|
|
|
|
namespace PR12890 {
|
|
|
|
class Document
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Document() = default;
|
|
|
|
|
|
|
|
template <class T>
|
|
|
|
explicit
|
|
|
|
Document(T&& t) : Document()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
void f()
|
|
|
|
{
|
|
|
|
Document d(1);
|
|
|
|
}
|
|
|
|
}
|