aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiate-complete.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-07 00:28:31 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-07 00:28:31 +0000
commitabfe1925e7cb0fbc36944f376b0695a68eebb455 (patch)
tree273a1235bda11dbe93c1d6e1fb89f4a070e3a023 /test/SemaTemplate/instantiate-complete.cpp
parent8eb662ed5e04bd0f494c7dbefacb7d45660ab9fa (diff)
When determining whether the two types involved in reference binding
are reference-compatible, reference-related, etc., do not complete the type of the reference itself because it is not necessary to determine well-formedness of the program. Complete the type that we are binding to, since that can affect whether we know about a derived-to-base conversion. Fixes PR7080. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103220 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-complete.cpp')
-rw-r--r--test/SemaTemplate/instantiate-complete.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-complete.cpp b/test/SemaTemplate/instantiate-complete.cpp
index d854c9e6aa..a2cb049173 100644
--- a/test/SemaTemplate/instantiate-complete.cpp
+++ b/test/SemaTemplate/instantiate-complete.cpp
@@ -99,3 +99,23 @@ namespace TemporaryObjectCopy {
template void f(int);
}
+
+namespace PR7080 {
+ template <class T, class U>
+ class X
+ {
+ typedef char true_t;
+ class false_t { char dummy[2]; };
+ static true_t dispatch(U);
+ static false_t dispatch(...);
+ static T trigger();
+ public:
+ enum { value = sizeof(dispatch(trigger())) == sizeof(true_t) };
+ };
+
+ template <class T>
+ class rv : public T
+ { };
+
+ bool x = X<int, rv<int>&>::value;
+}