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

            Bug ID: 126993
           Summary: Ill-formed program with identity conversion accepted
                    by gcc
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jlame646 at gmail dot com
  Target Milestone: ---

This seems to be ill-formed as per current wording but all compilers includig
gcc accept it.  
```
struct S {   
};
template<typename T> constexpr int f(S&&){return 10;}
constexpr int f(const S&){return 4;}
static_assert(f(S{})==4);                     //#4 all compilers accept this
but ill-formed as per current wording 


```

Reply via email to