[cfe-commits] r91747 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/SemaTemplate/member-access-expr.cpp
John McCall
rjmccall at apple.com
Fri Dec 18 18:05:44 PST 2009
Author: rjmccall
Date: Fri Dec 18 20:05:44 2009
New Revision: 91747
URL: http://llvm.org/viewvc/llvm-project?rev=91747&view=rev
Log:
Unresolved implicit member accesses are dependent if the object type is dependent.
Avoids an assertion arising during object-argument initialization in overload
resolution. In theory we can resolve this at definition time if the class
hierarchy for the member is fully known.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/SemaTemplate/member-access-expr.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=91747&r1=91746&r2=91747&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Dec 18 20:05:44 2009
@@ -2417,6 +2417,7 @@
// result.
if (R.isOverloadedResult() || R.isUnresolvableResult()) {
bool Dependent =
+ BaseExprType->isDependentType() ||
R.isUnresolvableResult() ||
UnresolvedLookupExpr::ComputeDependence(R.begin(), R.end(), TemplateArgs);
Modified: cfe/trunk/test/SemaTemplate/member-access-expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/member-access-expr.cpp?rev=91747&r1=91746&r2=91747&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/member-access-expr.cpp (original)
+++ cfe/trunk/test/SemaTemplate/member-access-expr.cpp Fri Dec 18 20:05:44 2009
@@ -105,3 +105,17 @@
x5.f(xp);
x5c.g(cxp);
}
+
+// In theory we can do overload resolution at template-definition time on this.
+// We should at least not assert.
+namespace test4 {
+ struct Base {
+ template <class T> void foo() {}
+ };
+
+ template <class T> struct Foo : Base {
+ void test() {
+ foo<int>();
+ }
+ };
+}
More information about the cfe-commits
mailing list