diff options
author | Alexis Hunt <alercah@gmail.com> | 2011-05-18 03:41:58 +0000 |
---|---|---|
committer | Alexis Hunt <alercah@gmail.com> | 2011-05-18 03:41:58 +0000 |
commit | e77a28f7e1ff0b5523107c7a42fae7c063a2b732 (patch) | |
tree | 5005245604aa21256759f0ddb7e32fac790dd229 /clang/test/SemaCXX/defaulted-ctor-loop.cpp | |
parent | f9839e425745648fb72859e20920af27101acf0f (diff) | |
download | bcm5719-llvm-e77a28f7e1ff0b5523107c7a42fae7c063a2b732.tar.gz bcm5719-llvm-e77a28f7e1ff0b5523107c7a42fae7c063a2b732.zip |
Implement an additional fix for infinite recursion of deleted special
member functions by making sure that they're on the record before
checking for deletion.
Also make sure source locations are valid to avoid crashes.
Unfortunately, the declare-all-implicit-members approach is still
required in order to ensure that dependency loops do not result in
incorrectly deleting functions (since they are to be deleted at the
declaration point per the standard).
Fixes PR9917
llvm-svn: 131520
Diffstat (limited to 'clang/test/SemaCXX/defaulted-ctor-loop.cpp')
-rw-r--r-- | clang/test/SemaCXX/defaulted-ctor-loop.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/defaulted-ctor-loop.cpp b/clang/test/SemaCXX/defaulted-ctor-loop.cpp new file mode 100644 index 00000000000..6a41972cf75 --- /dev/null +++ b/clang/test/SemaCXX/defaulted-ctor-loop.cpp @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s + +// WARNING: This test may recurse infinitely if failing. + +struct foo; +struct bar { + bar(foo&); +}; +struct foo { + bar b; + foo() + : b(b) // expected-warning{{field is uninitialized}} + {} +}; |