diff options
| author | David Blaikie <dblaikie@gmail.com> | 2012-05-28 01:26:45 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2012-05-28 01:26:45 +0000 |
| commit | c4c0e8aa9ab4e0a8b4c9dd74a00e0757bccadea0 (patch) | |
| tree | ec54f1dae5aac639a72c4e92d3c079247d44895b /clang/lib/Sema/SemaExpr.cpp | |
| parent | 7fb195b683ba1d4627da76707bd1a7d1c611dab5 (diff) | |
| download | bcm5719-llvm-c4c0e8aa9ab4e0a8b4c9dd74a00e0757bccadea0.tar.gz bcm5719-llvm-c4c0e8aa9ab4e0a8b4c9dd74a00e0757bccadea0.zip | |
Fix PR12960 by not attempting to correct cases when we're not actually instantiatiating a template.
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.
llvm-svn: 157553
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index ce4234b7b06..91e0f721b63 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -1371,7 +1371,8 @@ bool Sema::DiagnoseEmptyLookup(Scope *S, CXXScopeSpec &SS, LookupResult &R, // 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); |

