This is the mail archive of the gcc-help@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]

Should std::byte copy-list-initialization fail?


I'm working on Fedora 26 with GCC 7.1.1. I'm testing some C++17 code
and learning where some of the pain points are.

$ cat test.cxx
#include <cstddef>
int main(int argc, char* argv[])
{
  std::byte b1 {0x65};
  std::byte b2 = {0x66};
  return 0;
}

test.cxx: In function ‘int main(int, char**)’:
test.cxx:5:23: error: cannot convert ‘int’ to ‘std::byte’ in initialization
   std::byte b2 = {0x66};
                       ^

It seems like there should be enough information for the compiler to
determine the list argument type and avoid the error (for b2) like in
the first example (for b1).

Is the copy-list-initialization failure expected?

Jeff


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