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

            Bug ID: 109529
           Summary: the r-value volatile object is not accepted by the
                    l-value volatile constant argument.
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lisp2d at rambler dot ru
  Target Milestone: ---

void funy(int const &){}
void fun(int volatile const &){}
int main(){
  int y ;
  funy(y); // good
  funy(static_cast<int && >(y)); // good
  funy(static_cast<int const && >(y)); // good
  int volatile x ;
  fun(x); // good
  fun(static_cast<int volatile && >(x)); // error
  fun(static_cast<int volatile const && >(x)); // error
}

Reply via email to