While the test cases in upstream bug report work if doing an explicit type cast, or not using the explicit keyword in the cast operators, the reasoning is that the type conversion should be done: """ With a class which has an explicit type cast operator: struct X { unsigned data_; explicit operator unsigned() const {return data_;} }; Assuming x_ is with type X, this works: unsigned t{x_}; But below few cases does not work unsigned t1 = unsigned{x_}; auto t2 = unsigned{x_}; return unsigned{x_}; unsigned{x_} should have same effect as explicit type cast in the above example. """
The upstream PR has been fixed and the fix will be included in DTS 6.1. The #c0 snippet is not self-contained, so are you talking about something from the upstream PR that you believe is still not fixed? Can you provide self-contained testcase?
(In reply to Jakub Jelinek from comment #2) > The upstream PR has been fixed and the fix will be included in DTS 6.1. > The #c0 snippet is not self-contained, so are you talking about something > from the upstream PR that you believe is still not fixed? Can you provide > self-contained testcase? No. I was asking from this RH BZ point. Just wanted to understand if we have plans to backport the fix in the next DTS release. Thanks for the reply.
Successfully tested devtoolset-6-gcc-6.3.1-3.1.el{6,7}, all architectures: PASS: g++.dg/cpp0x/initlist-explicit1.C -std=c++11 (test for excess errors) PASS: g++.dg/cpp0x/initlist-explicit1.C -std=c++14 (test for excess errors) UNSUPPORTED: g++.dg/cpp0x/initlist-explicit1.C -std=c++98 PASS: g++.dg/cpp0x/initlist-explicit1.C -std=c++11 (test for excess errors) PASS: g++.dg/cpp0x/initlist-explicit1.C -std=c++14 (test for excess errors) UNSUPPORTED: g++.dg/cpp0x/initlist-explicit1.C -std=c++98 VERIFIED
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:1143