On 08/02/16 20:38, Richard Smith wrote:
On Mon, Feb 8, 2016 at 11:25 AM, Vassil Vassilev <v.g.vassi...@gmail.com <mailto:v.g.vassi...@gmail.com>> wrote:

    On 08/02/16 20:10, Richard Smith via cfe-commits wrote:

        Author: rsmith
        Date: Mon Feb  8 13:10:14 2016
        New Revision: 260124

        URL: http://llvm.org/viewvc/llvm-project?rev=260124&view=rev
        Log:
        Remove dead code.

        Modified:
             cfe/trunk/lib/Sema/SemaLookup.cpp

        Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
        URL:
        
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=260124&r1=260123&r2=260124&view=diff
        
==============================================================================
        --- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
        +++ cfe/trunk/lib/Sema/SemaLookup.cpp Mon Feb  8 13:10:14 2016
        @@ -432,10 +432,6 @@ static bool isPreferredLookupResult(Sema
              if (Prev == EUnderlying)
                return true;
            return false;
        -
        -  // If the existing declaration is hidden, prefer the new
        one. Otherwise,
        -  // keep what we've got.
        -  return !S.isVisible(Existing);

    Shouldn't we generally prefer the new D if the Existing is hidden?


We do in most cases; see the check a few lines above. This is only reached for the case of functions and variables, where picking the visible result can lose information. Note that when forming the set of declarations, we'll skip hidden results in cases where they're not an acceptable lookup result; in practice, we only get here for redeclaration lookup of a variable or function.
Got it, thanks!

          }
            /// Determine whether \p D can hide a tag declaration.


        _______________________________________________
        cfe-commits mailing list
        cfe-commits@lists.llvm.org <mailto:cfe-commits@lists.llvm.org>
        http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits




_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to