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

            Bug ID: 68092
           Summary: [possibly concepts] ICE: symtab_node::verify failed.
                    Overloaded function by concept requires
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chrisb2244 at gmail dot com
  Target Milestone: ---

Unsure if this is a bug or just bad code on my part. Can't produce a simple
test case.

Class compiles and program runs when using the signature/declaration of a pair
of functions as follows

////////////////////////////////////////////////////////////////////////
namespace detail {
    enum class enabler {};
}

template<size_t M>
class Mesh
{
public:
    template<size_t m=M, std::enable_if<m>=2, detail::enabler>::type...>
    size_t yCells() const { return dimSize_[1]; }
    template<size_t m=M, std::enable_if<m<2, detail::enabler>::type...>
    size_t yCells() const { return 0; }
}
/////////////////////////////////////////////////////////////////////////

fails with 
Two symbols with same comdat_group are not linked by the same_comdat_group
list.
template class Mesh<3>;

_ZNK4MeshILm3EE6yCellsEv/711 (size_t Mesh<meshDim>::yCells() const [with long
unsigned int meshDim = 3ul]) @address
  Type: function definition analyzed
  Visibility: forced_by_abi public weak comdat_group:_ZNK4MeshILm3EE6yCellsEv
one_only
  previous sharing asm name: 710
  References: 
  Referring: 
  First run: 0
  Function flags: body
  Called by: 
  Calls: 
_ZN_ZNK4MeshILm3EE6yCellsEv/710 (size_t Mesh<meshDim>::yCells() const requires
predicate( true) [with long unsigned int meshDim = 3ul]) @0x7f20e64268a0
  Type: function definition analyzed
  Visibility: forced_by_abi public weak comdat_group:_ZNK4MeshILm3EE6yCellsEv
one_only
  next sharing asm name: 711
  References: 
  Referring: 
  First run: 0
  Function flags: body
  Called by: 
  Calls: _ZNKSt6vectorImSaImEEixEm/1078 (1.00 per call) 
<...>/Mesh.cpp:183:23: internal compiler error: symtab_node::verify failed
0x904339 symtab_node::verify_symtab_nodes()
        ../../gcc-svn-sources/gcc/symtab.c:1126


when using either of
///////////////////////////////////////////
size_t yCells() const requires true { return dimSize_[1]; }
size_t yCells() const { return 0; }
///////////////////////////////////////////
template<size_t N>
concept bool Mesh2D() {
    return N>=2;
}

template<size_t meshDim>
class Mesh
{
public:
    size_t yCells() const requires Mesh2D<meshDim>() { return dimSize_[1]; }
    size_t yCells() const { return 0; }
/////////////////////////////////////////////

Reply via email to