summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/dependent-expr.cpp
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
commit501edb6a54524555ad27fbf41a7920dc756b08c6 (patch)
tree2cda01b3f34a56c14707ce971563bfd2c37cee99 /test/SemaTemplate/dependent-expr.cpp
parent1cfb7da1f34723021f362cb09636965e5ade0c6d (diff)
downloadclang-501edb6a54524555ad27fbf41a7920dc756b08c6.tar.gz
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93514 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/dependent-expr.cpp')
-rw-r--r--test/SemaTemplate/dependent-expr.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/SemaTemplate/dependent-expr.cpp b/test/SemaTemplate/dependent-expr.cpp
index 412a811f72..3f481b5136 100644
--- a/test/SemaTemplate/dependent-expr.cpp
+++ b/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);
+ }
+}