constructor template. Fixes PR10457.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140350
91177308-0d34-0410-b5e6-
96231b3b80d8
CXXCtorInitializer **Initializers,
unsigned NumInitializers,
bool AnyErrors) {
- if (Constructor->getDeclContext()->isDependentContext()) {
+ if (Constructor->isDependentContext()) {
// Just store the initializers as written, they will be checked during
// instantiation.
if (NumInitializers > 0) {
--- /dev/null
+// RUN: %clang_cc1 -fsyntax-only -std=c++0x %s -verify
+
+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");
+ }
+}