diff options
| author | Alexis Hunt <alercah@gmail.com> | 2011-05-04 23:29:54 +0000 |
|---|---|---|
| committer | Alexis Hunt <alercah@gmail.com> | 2011-05-04 23:29:54 +0000 |
| commit | 27a761d5bde0255ae6fbe71c5239544db81e2d63 (patch) | |
| tree | 17d84135c5e1c826ab6356ccd573ce01f4ac4aef /clang/test/PCH/cxx0x-delegating-ctors.cpp | |
| parent | 2159b8d2461b00f0a7e6de8e8789db5645287ae1 (diff) | |
| download | bcm5719-llvm-27a761d5bde0255ae6fbe71c5239544db81e2d63.tar.gz bcm5719-llvm-27a761d5bde0255ae6fbe71c5239544db81e2d63.zip | |
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
Diffstat (limited to 'clang/test/PCH/cxx0x-delegating-ctors.cpp')
| -rw-r--r-- | clang/test/PCH/cxx0x-delegating-ctors.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
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 |

