This revision was automatically updated to reflect the committed changes.
Closed by commit rL304964: Improve diagnostics if friend function redefines
file-level function. (authored by sepavloff).
Changed prior to commit:
https://reviews.llvm.org/D26065?vs=101666&id=101859#toc
Repository:
rL
arphaman accepted this revision.
arphaman added a comment.
This revision is now accepted and ready to land.
LGTM.
https://reviews.llvm.org/D26065
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/
sepavloff updated this revision to Diff 101666.
sepavloff added a comment.
Rebased and enhance check
https://reviews.llvm.org/D26065
Files:
lib/Sema/SemaDeclCXX.cpp
test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp
Index: test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp
=
sepavloff added inline comments.
Comment at: lib/Sema/SemaDeclCXX.cpp:646
+ // in this case, redefinition will be diagnosed later.
+ (New->isInlineSpecified() || !New->isOutOfLine() ||
+ !New->getLexicalDeclContext()->isRecord())) {
--
arphaman added inline comments.
Comment at: lib/Sema/SemaDeclCXX.cpp:646
+ // in this case, redefinition will be diagnosed later.
+ (New->isInlineSpecified() || !New->isOutOfLine() ||
+ !New->getLexicalDeclContext()->isRecord())) {
---
sepavloff added a comment.
Ping.
https://reviews.llvm.org/D26065
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
sepavloff updated this revision to Diff 76520.
sepavloff added a comment.
Do not use getFriendObjectKind(), friend kind sometimes is set too late.
https://reviews.llvm.org/D26065
Files:
lib/Sema/SemaDeclCXX.cpp
test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp
Index: test/CXX/dcl.dcl/dcl.spec
sepavloff created this revision.
sepavloff added a subscriber: cfe-commits.
Clang makes check for function redefinition after it merged the new
declaration with the existing one. As a result, it produces poor
diagnostics in the case of a friend function defined inline, as in
the code:
void func