This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/67719] New: [concepts] bug with concepts using logical or


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

            Bug ID: 67719
           Summary: [concepts] bug with concepts using logical or
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ryan.burn at gmail dot com
  Target Milestone: ---

This code fails to compile but should.

It gives the following error:

main.cpp: In function âint main()â:
main.cpp:11:15: error: template constraint failure
   Ax<int, long> a;
               ^
main.cpp:11:15: note:   constraints not satisfied
main.cpp:11:15: note:   in the expansion of â(C<Tx>)()...â

/////////////////////////////////////////////////////////////////////
#include <type_traits>                                                          

template<class X> concept bool C() {                                            
  return std::is_same<X, int>::value || std::is_same<X, long>::value;           
}                                                                               

template<C... Tx>                                                               
struct Ax {};                                                                   

int main() {                                                                    
  Ax<int, long> a;                                                              
  return 0;                                                                     
}
/////////////////////////////////////////////////////////////////////

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]