Hi Markus, I am not familiar with this piece of code, but I think the assert is worth keeping. It verifies function resolveKind does not make ResolveKind ambiguous if it wasn't ambiguous before. Am I correct?
Jingyue On Sat Oct 04 2014 at 3:42:59 AM Markus Trippelsdorf <[email protected]> wrote: > > > On 2014.10.03 at 22:16 -0000, Jingyue Wu wrote: > > Author: jingyue > > Date: Fri Oct 3 17:16:40 2014 > > New Revision: 219029 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=219029&view=rev > > Log: > > Suppress defined-but-unused warnings > > > > by adding a fake use > > Why not get rid of WasAmbiguous altogether? It does nothing AFAICS. > > diff --git a/clang/include/clang/Sema/Lookup.h b/clang/include/clang/Sema/ > Lookup.h > index 067e42210fde..b88b9682788e 100644 > --- a/clang/include/clang/Sema/Lookup.h > +++ b/clang/include/clang/Sema/Lookup.h > @@ -425,10 +425,8 @@ public: > } > } else { > AmbiguityKind SavedAK; > - bool WasAmbiguous = false; > if (ResultKind == Ambiguous) { > SavedAK = Ambiguity; > - WasAmbiguous = true; > } > ResultKind = Found; > resolveKind(); > @@ -436,8 +434,6 @@ public: > // If we didn't make the lookup unambiguous, restore the old > // ambiguity kind. > if (ResultKind == Ambiguous) { > - (void)WasAmbiguous; > - assert(WasAmbiguous); > Ambiguity = SavedAK; > } else if (Paths) { > deletePaths(Paths); > > -- > Markus > >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
