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

            Bug ID: 84140
           Summary: Inline friends are not constrained by concepts
           Product: gcc
           Version: 7.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cjdb.ns at gmail dot com
  Target Milestone: ---

Created attachment 43301
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43301&action=edit
example.ii as produced by -save-temps

## Summary

Inline friends do not appear to be constrained by concepts.

## GCC version

Bugzilla report: g++-7 (Ubuntu 7.2.0-1ubuntu1~16.04) 7.2.0
Observed on:

* GCC trunk
* GCC 7.3
* GCC 7.2
* GCC 7.1
* GCC 6.3
* GCC 6.2
* GCC 6.1

## System type

Observed on:

* g++-7 (Ubuntu 7.2.0-1ubuntu1~16.04) 7.2.0
* g++.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 7.2.0

## Command

g++-7 -fconcepts -std=c++17 -Wall -Wextra -Wpedantic -Wconversion -Werror
-save-temps example.cpp

## Diagnostic

example.cpp: In function ‘int main()’:
example.cpp:29:27: error: ambiguous overload for ‘operator==’ (operand types
are ‘uniform<int>’ and ‘uniform<int>’)
     return uniform<int>{} == uniform<int>{};
            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
example.cpp:22:16: note: candidate: bool operator==(const T2&, const
uniform<T>&) [with T2 = uniform<int>; T = int]
    friend bool operator==(const T2&, const uniform&) noexcept
                ^~~~~~~~
example.cpp:15:16: note: candidate: bool operator==(const uniform<T>&, const
uniform<T2>&) [with T2 = int; T = int]
    friend bool operator==(const uniform&, const uniform<T2>&) noexcept
                ^~~~~~~~

Reply via email to