1762bb9d0ad20320b9f97a841dce57ba5e8e48b07Richard Smith// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify 2d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor 3d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregornamespace PR10457 { 4d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor 5d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor class string 6d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor { 7d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor string(const char* str, unsigned); 8d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor 9d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor public: 10d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor template <unsigned N> 11d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor string(const char (&str)[N]) 12d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor : string(str) {} // expected-error{{constructor for 'string<6>' creates a delegation cycle}} 13d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor }; 14d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor 15d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor void f() { 16d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor string s("hello"); 17d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor } 18d836c0d379403a173ae1ede56fcad034d04a1e34Douglas Gregor} 19