summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-01-15 16:21:02 +0000
committerDouglas Gregor <dgregor@apple.com>2010-01-15 16:21:02 +0000
commit5fcb51c09cdbcb3533dc868343dfcc989e7f653d (patch)
tree63458197b7224e7afa3af9298cda8472d1f53014 /clang/test
parent27b174f4c3f27e68f45a2e26d71cc46a72149192 (diff)
downloadbcm5719-llvm-5fcb51c09cdbcb3533dc868343dfcc989e7f653d.tar.gz
bcm5719-llvm-5fcb51c09cdbcb3533dc868343dfcc989e7f653d.zip
When determining whether a DeclRefExpr is value-dependent when it
references a const variable of integral type, the initializer may be in a different declaration than the one that name-lookup saw. Find the initializer anyway. Fixes PR6045. llvm-svn: 93514
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaTemplate/dependent-expr.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/dependent-expr.cpp b/clang/test/SemaTemplate/dependent-expr.cpp
index 412a811f729..3f481b51369 100644
--- a/clang/test/SemaTemplate/dependent-expr.cpp
+++ b/clang/test/SemaTemplate/dependent-expr.cpp
@@ -5,3 +5,22 @@ template <typename Iterator>
void Test(Iterator it) {
*(it += 1);
}
+
+namespace PR6045 {
+ template<unsigned int r>
+ class A
+ {
+ static const unsigned int member = r;
+ void f();
+ };
+
+ template<unsigned int r>
+ const unsigned int A<r>::member;
+
+ template<unsigned int r>
+ void A<r>::f()
+ {
+ unsigned k;
+ (void)(k % member);
+ }
+}
OpenPOWER on IntegriCloud