[cfe-commits] r94814 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/SemaTemplate/qualified-id.cpp
Douglas Gregor
dgregor at apple.com
Fri Jan 29 09:15:44 PST 2010
Author: dgregor
Date: Fri Jan 29 11:15:43 2010
New Revision: 94814
URL: http://llvm.org/viewvc/llvm-project?rev=94814&view=rev
Log:
When naming a function template via a qualified-id (or any other way
that ADL is suppressed), we need to build an
UnresolvedLookupExpr. Fixes PR6063, which was hitting Boost headers
pretty hard.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/SemaTemplate/qualified-id.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=94814&r1=94813&r2=94814&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Jan 29 11:15:43 2010
@@ -1487,7 +1487,7 @@
bool NeedsADL) {
// If this is a single, fully-resolved result and we don't need ADL,
// just build an ordinary singleton decl ref.
- if (!NeedsADL && R.isSingleResult())
+ if (!NeedsADL && R.isSingleResult() && !R.getAsSingle<FunctionTemplateDecl>())
return BuildDeclarationNameExpr(SS, R.getNameLoc(), R.getFoundDecl());
// We only need to check the declaration if there's exactly one
Modified: cfe/trunk/test/SemaTemplate/qualified-id.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/qualified-id.cpp?rev=94814&r1=94813&r2=94814&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/qualified-id.cpp (original)
+++ cfe/trunk/test/SemaTemplate/qualified-id.cpp Fri Jan 29 11:15:43 2010
@@ -29,3 +29,18 @@
}
};
}
+
+namespace PR6063 {
+ template <typename T> void f(T, T);
+
+ namespace detail
+ {
+ using PR6063::f;
+ }
+
+ template <typename T>
+ void g(T a, T b)
+ {
+ detail::f(a, b);
+ }
+}
More information about the cfe-commits
mailing list