This comes up in the begin/end calls of a range-for (see the included test
case). Other suggestions are welcome, though this seems to do the trick without
regressing anything.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157553
91177308-0d34-0410-b5e6-
96231b3b80d8
// unqualified lookup. This is useful when (for example) the
// original lookup would not have found something because it was a
// dependent name.
- DeclContext *DC = SS.isEmpty() ? CurContext : 0;
+ DeclContext *DC = (SS.isEmpty() && !CallsUndergoingInstantiation.empty())
+ ? CurContext : 0;
while (DC) {
if (isa<CXXRecordDecl>(DC)) {
LookupQualifiedName(R, DC);
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+struct pr12960 {
+ int begin;
+ void foo(int x) {
+ for (int& it : x) { // expected-error {{use of undeclared identifier 'begin'}} expected-note {{range has type 'int'}}
+ }
+ }
+};
+
namespace std {
template<typename T>
auto begin(T &&t) -> decltype(t.begin()) { return t.begin(); } // expected-note 4{{ignored: substitution failure}}
for (int &x : array)
x *= 2;
}
+