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

            Bug ID: 79714
           Summary: <string> error on assigning from char
           Product: gcc
           Version: 6.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jmichae3 at yahoo dot com
  Target Milestone: ---

Created attachment 40832
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40832&action=edit
source

#include <string>
int main(int argc, char ** argv) {
    typedef char CH;
    typedef std::string ST;
    CH c='a';
    ST sSignsDot=groupChar;
    return 0;
}

throws an error *like* this one:
 Sat 02/25/2017 15:32:14.39 L:\projects\lib\atoi64\tests>g++ -static -std=c++11
-lstdc++ -o unit-test-char-assign-string.exe unit-test-char-assign-string.cpp
unit-test-char-assign-string.cpp: In function 'int main(int, char**)':
unit-test-char-assign-string.cpp:6:18: error: conversion from 'CH {aka char}'
to non-scalar type 'ST {aka std::__cxx11::basic_string<char>}' requested
     ST sSignsDot=c;
                  ^

 Sat 02/25/2017 15:32:32.45 L:\projects\lib\atoi64\tests>


this was supposed to be working in c++98, so I assumme also in c++11 and c++14.

Reply via email to