blob: e177b50375f010a76723235e2076305717d80c09 [file] [log] [blame]
Richard Smith762bb9d2011-10-13 22:29:44 +00001// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
Douglas Gregord836c0d2011-09-22 23:04:35 +00002
3namespace PR10457 {
4
5 class string
6 {
7 string(const char* str, unsigned);
8
9 public:
10 template <unsigned N>
11 string(const char (&str)[N])
12 : string(str) {} // expected-error{{constructor for 'string<6>' creates a delegation cycle}}
13 };
14
15 void f() {
16 string s("hello");
17 }
Douglas Gregor76852c22011-11-01 01:16:03 +000018
19 struct Foo {
20 Foo(int) { }
21
22
23 template <typename T>
24 Foo(T, int i) : Foo(i) { }
25};
26
27 void test_Foo()
28 {
29 Foo f(1, 1);
30 }
Douglas Gregord836c0d2011-09-22 23:04:35 +000031}