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

            Bug ID: 108590
           Summary: Wrong integer promotoion for consteval
           Product: gcc
           Version: 12.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: HZ2012 at gmx dot at
  Target Milestone: ---

#include <iostream>
constexpr int8_t operator"" _int8_constexpr(unsigned long long int val) {
return val; }
consteval int8_t operator"" _int8_consteval(unsigned long long int val) {
return val; }

void f(int)
{
   std::cout << "int\n";
}
void f(int8_t)
{
   std::cout << "int8_t\n";
}
int main()
{
    f(-1_int8_constexpr);
    f(-1_int8_consteval);
}

Output of gcc:

int
int8_t

Output of clang 15: 

int
int

Reply via email to