summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-12-23 23:03:06 +0000
committerDouglas Gregor <dgregor@apple.com>2009-12-23 23:03:06 +0000
commit033f675f61e0aed3ba99a0aa913034ca741e03ad (patch)
treea870962a4706bb000c8421141910f3cdbd7f433a /clang/test/SemaTemplate
parent3fe18e72b3589b32f2de3c57c6b8b9d866b07190 (diff)
downloadbcm5719-llvm-033f675f61e0aed3ba99a0aa913034ca741e03ad.tar.gz
bcm5719-llvm-033f675f61e0aed3ba99a0aa913034ca741e03ad.zip
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. llvm-svn: 92078
Diffstat (limited to 'clang/test/SemaTemplate')
-rw-r--r--clang/test/SemaTemplate/default-expr-arguments.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/clang/test/SemaTemplate/default-expr-arguments.cpp b/clang/test/SemaTemplate/default-expr-arguments.cpp
index 0635801c9fd..0edc504ea0a 100644
--- a/clang/test/SemaTemplate/default-expr-arguments.cpp
+++ b/clang/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}}
+ }
}
OpenPOWER on IntegriCloud