Don't try to use !Previous.empty() as a proxy for "Is this a redeclaration?" --
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 21 Oct 2016 03:15:03 +0000 (03:15 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 21 Oct 2016 03:15:03 +0000 (03:15 +0000)
commitfdf0888b6969864d18ce262f4b343d9226b9e22a
tree5cf79945f62712c4cfdac4754e161e05efe6bc2e
parent81440dc93fa423a620094f0d9afd58e1b8e4b3aa
Don't try to use !Previous.empty() as a proxy for "Is this a redeclaration?" --
we don't collapse that down to a single entry if it's not a redeclaration.
Instead, set the Redeclaration bit on the Declarator to indicate whether a
function is a redeclaration (which may not have been linked into the
redeclaration chain if it's a dependent context friend).

Fixes a rejects-valid; see testcase.

llvm-svn: 284802
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/test/SemaCXX/friend.cpp