Douglas Gregor wrote:
> Author: dgregor
> Date: Wed Jan 14 16:20:51 2009
> New Revision: 62245
>
> URL: http://llvm.org/viewvc/llvm-project?rev=62245&view=rev
> Log:
> Refactor name lookup.
>
> This change refactors and cleans up our handling of name lookup with
> LookupDecl. There are several aspects to this refactoring:
>
>
> +/// @brief Determine the result of name lookup.
> +Sema::LookupResult::LookupKind Sema::LookupResult::getKind() const {
> +  switch (StoredKind) {
> +  case SingleDecl:
> +    return (reinterpret_cast<Decl *>(First) != 0)? Found : NotFound;
> +
> +  case OverloadedDeclFromIdResolver:
> +  case OverloadedDeclFromDeclContext:
> +    return FoundOverloaded;
> +
> +  case AmbiguousLookup:
> +    return Ambiguous;
> +  }
> +
> +  // We can't get here, but GCC complains nonetheless.
> +  return Ambiguous;
> +}
>   

I believe our standard way of handling this is by having a default case
that asserts.

switch (StoredKind) {
default: assert(false && "Bad StoredKind");

Sebastian
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to