https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59480

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #11 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Hmm, it seems as if now too much is rejected - unless, I misunderstand some
rules (which is also likely).

The following compiles with GCC 8 and my very old Clang 3.7.0, but it fails now
on the trunk with the patch with:


foo.cc:3:8: error: friend declaration of ‘Matrix rot90(const Matrix&, int)’
specifies default arguments and isn't the only declaration [-fpermissive]
 Matrix rot90 (const Matrix& a, int k) {
        ^~~~~
In file included from foo.cc:1:
foo.h:5:19: note: previous declaration of ‘Matrix rot90(const Matrix&, int)’
     friend Matrix rot90 (const Matrix&, int); //no default values here
                   ^~~~~


# head foo.h foo.cc

==> foo.h <==
class Matrix;
Matrix rot90 (const Matrix& a, int k = 1);

class Matrix {
    friend Matrix rot90 (const Matrix&, int); //no default values here
};

==> foo.cc <==
#include "foo.h"

Matrix rot90 (const Matrix& a, int k) {
  return Matrix();
}

Reply via email to