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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|error-recovery              |
                 CC|redi at gcc dot gnu.org            |

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The only real difference between Clang and G++ here is that Clang preserves the
vector<Real> type in the output, but G++ shows vector<double>.

GCC's first line shows the 

52801.cc:9:8: error: no match for ‘operator=’ (operand types are
‘std::__cxx11::string {aka std::__cxx11::basic_string<char>}’ and
‘std::vector<double>’)

This uses "aka" to relate the type shown in the source (which might be a
typedef) with the canonical types shown in the later errors. If that first line
said "'vector<Real>' {aka 'std::vector<double>'}" I think it would be fine.

The fact the typedef is preserved for the string but not the vector may be
because the string is declared using a typedef ("string") but the vector is not
("Real" is a typedef, but "vector<Real>" is not).


Some of the other differences are due to comparing apples with oranges:

- Several more lines in GCC output, because the clang test was done with
-std=gnu++98 and the GCC one with -std=gnu++14, so there are extra overloads in
the GCC version. Clang also prints more lines for recent standards.

- Clang shows std::basic_string<char> and gcc shows
std::__cxx11::basic_string<char>, but only because the clang test was using GCC
4.3 headers. Using libc++ headers shows std::__1::basic_string<char> which is
no better. N.B. GCC would be improved by PR 81239, so that the first line would
show "std::string {aka 'std::__cxx11::basic_string'}". I might even be able to
make that happen with a libstdc++ change.

Reply via email to