diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-09-14 22:55:20 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-09-14 22:55:20 +0000 |
commit | 5833b0b831d6afae2885e6af420e2bda639652e6 (patch) | |
tree | 9cd679ee2d9b42308f7c88f81f1b1665564a414d /test/SemaTemplate/default-expr-arguments.cpp | |
parent | 4178b573b82449c2d888ea1f0957a478534e118c (diff) |
When marking the declarations in a default argument expression as
"used", at the time that the default argument itself is used, also
mark destructors that will be called by this expression. This fixes a
regression that I introduced in r113700, which broke WebKit, and fixes
<rdar://problem/8427926>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113883 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/default-expr-arguments.cpp')
-rw-r--r-- | test/SemaTemplate/default-expr-arguments.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/SemaTemplate/default-expr-arguments.cpp b/test/SemaTemplate/default-expr-arguments.cpp index 8fc241d5b2..eff59a84e3 100644 --- a/test/SemaTemplate/default-expr-arguments.cpp +++ b/test/SemaTemplate/default-expr-arguments.cpp @@ -252,3 +252,25 @@ namespace PR8127 { void foo( PointerClass<ExternallyImplementedClass> = 0 ); }; } + +namespace rdar8427926 { + template<typename T> + struct Boom { + ~Boom() { + T t; + double *******ptr = t; // expected-error 2{{cannot initialize}} + } + }; + + Boom<float> *bfp; + + struct X { + void f(Boom<int> = Boom<int>()) { } // expected-note{{requested here}} + void g(int x = (delete bfp, 0)); // expected-note{{requested here}} + }; + + void test(X *x) { + x->f(); + x->g(); + } +} |