diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-23 23:03:06 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-23 23:03:06 +0000 |
commit | 036aed18662e0193aafe0e8ae13d2e57efe6df25 (patch) | |
tree | 40e67da6505f06471a854249e0a3ac17fd1c6045 /test/SemaTemplate/default-expr-arguments.cpp | |
parent | 8d9fb9b21364892b5e41ebfacdad8f41414d2b89 (diff) |
When we see a CXXDefaultArgExpr during template instantiation, rebuild
the default argument so that we're sure to mark any referenced
declarations. This gets us another little step closer to fixing
PR5810.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92078 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/default-expr-arguments.cpp')
-rw-r--r-- | test/SemaTemplate/default-expr-arguments.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/test/SemaTemplate/default-expr-arguments.cpp b/test/SemaTemplate/default-expr-arguments.cpp index 0635801c9f..0edc504ea0 100644 --- a/test/SemaTemplate/default-expr-arguments.cpp +++ b/test/SemaTemplate/default-expr-arguments.cpp @@ -147,16 +147,17 @@ namespace pr5301 { namespace PR5810 { template<typename T> struct allocator { - allocator() { int a[sizeof(T) ? -1 : -1]; } // expected-error{{array size is negative}} + allocator() { int a[sizeof(T) ? -1 : -1]; } // expected-error2 {{array size is negative}} }; template<typename T> struct vector { - vector(const allocator<T>& = allocator<T>()) {} // expected-note{{instantiation of}} + vector(const allocator<T>& = allocator<T>()) {} // expected-note2 {{instantiation of}} }; struct A { }; - + struct B { }; + template<typename> void FilterVTs() { vector<A> Result; @@ -165,4 +166,14 @@ namespace PR5810 { void f() { vector<A> Result; } + + template<typename T> + struct X { + vector<B> bs; + X() { } + }; + + void f2() { + X<float> x; // expected-note{{member function}} + } } |