From 27a761d5bde0255ae6fbe71c5239544db81e2d63 Mon Sep 17 00:00:00 2001 From: Alexis Hunt Date: Wed, 4 May 2011 23:29:54 +0000 Subject: there i fixed it Increase robustness of the delegating constructor cycle detection mechanism. No more infinite loops on invalid or logic errors leading to false results. Ensure that this is maintained correctly accross serialization. llvm-svn: 130887 --- clang/test/PCH/cxx0x-delegating-ctors.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'clang/test/PCH/cxx0x-delegating-ctors.cpp') diff --git a/clang/test/PCH/cxx0x-delegating-ctors.cpp b/clang/test/PCH/cxx0x-delegating-ctors.cpp index 132428957f7..15311f85294 100644 --- a/clang/test/PCH/cxx0x-delegating-ctors.cpp +++ b/clang/test/PCH/cxx0x-delegating-ctors.cpp @@ -1,12 +1,20 @@ // Test this without pch. -// RUN: %clang_cc1 -include %S/cxx0x-delegating-ctors.h -std=c++0x -fsyntax-only -verify %s +// RUN: %clang_cc1 -include %s -std=c++0x -fsyntax-only -verify %s // Test with pch. -// RUN: %clang_cc1 -x c++-header -std=c++0x -emit-pch -o %t %S/cxx0x-delegating-ctors.h +// RUN: %clang_cc1 -x c++-header -std=c++0x -emit-pch -o %t %s // RUN: %clang_cc1 -std=c++0x -include-pch %t -fsyntax-only -verify %s -// Currently we can't deal with a note in the header -// XFAIL: * - +#ifndef PASS1 +#define PASS1 +struct foo { + foo(int) : foo() { } // expected-note{{it delegates to}} + foo(); + foo(bool) : foo('c') { } // expected-note{{it delegates to}} + foo(char) : foo(true) { } // expected-error{{creates a delegation cycle}} \ + // expected-note{{which delegates to}} +}; +#else foo::foo() : foo(1) { } // expected-error{{creates a delegation cycle}} \ // expected-note{{which delegates to}} +#endif -- cgit v1.2.3