]> granicus.if.org Git - clang/commit
DR674, PR38883, PR40238: Qualified friend lookup should look for a
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 7 Jan 2019 06:00:46 +0000 (06:00 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 7 Jan 2019 06:00:46 +0000 (06:00 +0000)
commit02db2fa1a919655cb54a160131c3ca6a3fa215b5
tree739cca0952f0b9344e93b1bc928cf57f2b900d39
parent1a1eb1e55e1bccc461ae696bc445541f6fef3cd0
DR674, PR38883, PR40238: Qualified friend lookup should look for a
template specialization if there is no matching non-template function.

This exposed a couple of related bugs:
 - we would sometimes substitute into a friend template instead of a
   suitable non-friend declaration; this would now crash because we'd
   decide the specialization of the friend is a redeclaration of itself
 - ADL failed to properly handle the case where an invisible local
   extern declaration redeclares an invisible friend

Both are fixed herein: in particular, we now never make invisible
friends or local extern declarations visible to name lookup unless
they are the only declaration of the entity. (We already mostly did
this for local extern declarations.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350505 91177308-0d34-0410-b5e6-96231b3b80d8
17 files changed:
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Sema.h
lib/AST/DeclBase.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaLookup.cpp
lib/Sema/SemaOverload.cpp
lib/Sema/SemaTemplate.cpp
test/CXX/class.access/class.friend/p1.cpp
test/CXX/class.access/class.friend/p11.cpp
test/CXX/class/class.friend/p1.cpp
test/CXX/drs/dr1xx.cpp
test/CXX/drs/dr5xx.cpp
test/CXX/drs/dr6xx.cpp
test/SemaCXX/cxx1y-deduced-return-type.cpp
test/SemaCXX/friend.cpp
www/cxx_dr_status.html