llvm-project/clang/test/CXX/dcl.dcl/dcl.spec
Serge Pavlov 673f44c769 Improve diagnostics if friend function redefines file-level function.
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() {}
    class C { friend void func() {} };
```
Error message in this case states that `inline declaration of 'func'
follows non-inline definition`, which is misleading, as `func` does
not have explicit `inline` specifier.

With this changes compiler reports function redefinition if the new
function is a friend defined inline and it does not have explicit
`inline` specifier.

Differential Revision: https://reviews.llvm.org/D26065

llvm-svn: 304964
2017-06-08 06:07:07 +00:00
..
dcl.constexpr Implement C++17 P0386R2, inline variables. (The 'inline' specifier gives a 2016-06-25 00:15:56 +00:00
dcl.fct.spec Improve diagnostics if friend function redefines file-level function. 2017-06-08 06:07:07 +00:00
dcl.inline Implement C++17 P0386R2, inline variables. (The 'inline' specifier gives a 2016-06-25 00:15:56 +00:00
dcl.stc [Lit Test] Updated 34 Lit tests to be C++11 compatible. 2015-11-17 20:25:05 +00:00
dcl.type [c++1z] Diagnose attempts to use variables with deduced class template 2017-02-10 22:35:37 +00:00
dcl.typedef Push alias-declarations and alias-template declarations into scope even if 2016-07-15 20:53:25 +00:00