diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-10-19 17:17:35 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-10-19 17:17:35 +0000 |
| commit | f0873f4c853c0df10a41dd55f4fdda8a86b8ea99 (patch) | |
| tree | 061090cc7777bbcca4a2f59dc97c992ccd03bea0 /clang/test | |
| parent | 418204e5239a69ca252a233976ef12d52ff45029 (diff) | |
| download | bcm5719-llvm-f0873f4c853c0df10a41dd55f4fdda8a86b8ea99.tar.gz bcm5719-llvm-f0873f4c853c0df10a41dd55f4fdda8a86b8ea99.zip | |
When marking declarations referenced within an expression (e.g.,
within a default argument), recurse into default arguments. Fixes
PR8401, a regression I introduced in r113700 while refactoring our
handling of "used" declarations in default arguments.
llvm-svn: 116817
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/SemaTemplate/default-expr-arguments.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/default-expr-arguments.cpp b/clang/test/SemaTemplate/default-expr-arguments.cpp index eff59a84e30..8d54926b965 100644 --- a/clang/test/SemaTemplate/default-expr-arguments.cpp +++ b/clang/test/SemaTemplate/default-expr-arguments.cpp @@ -274,3 +274,21 @@ namespace rdar8427926 { x->g(); } } + +namespace PR8401 { + template<typename T> + struct A { + A() { T* x = 1; } // expected-error{{cannot initialize a variable of type 'int *' with an rvalue of type 'int'}} + }; + + template<typename T> + struct B { + B(const A<T>& a = A<T>()); // expected-note{{in instantiation of}} + }; + + void f(B<int> b = B<int>()); + + void g() { + f(); + } +} |

