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++/68683] New: [concepts] function satisfy_argument_deduction_constraint modifies a type tree node but leaves TYPE_CANONICAL unchanged


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

            Bug ID: 68683
           Summary: [concepts] function
                    satisfy_argument_deduction_constraint modifies a type
                    tree node but leaves TYPE_CANONICAL unchanged
           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: ---

The below code causes a "same canonical type node for different types" ICE
because the function satisfy_argument_deduction_constraint changes the
PLACEHOLDER_TYPE_CONSTRAINTS for a tree node but leaves the TYPE_CANONICAL
value unchanged. Since PLACEHOLDER_TYPE_CONSTRAINTS are used when checking for
equality, \ the TYPE_CANONICAL value is no longer valid for the changed type
which triggers the ICE.

///////////////////////////////////////////////////////////////////
template <typename, typename>                                                   
struct is_same  {                                                               
  static constexpr bool value = true;                                           
};                                                                              

template <typename T, typename U>                                               
concept bool Same = is_same<T, U>::value;                                       

template <typename T>                                                           
concept bool Integral = requires{                                               
  { T() } -> Same<typename T::value_type>;                                      
};                                                                              

struct A {                                                                      
  using value_type = bool;                                                      
};                                                                              

int main() {                                                                    
  Integral<A>;                                                                  
  Integral<A>;                                                                  
  return 0;                                                                     
}
///////////////////////////////////////////////////////////////////

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