[Bug c++/81239] std::__cxx11::string& visible in gcc warning output
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81239 --- Comment #10 from Jonny Grant --- Would you agree "abi11" would not have suffered the "cxx11" ambiguity? Hope this can be avoided next time another ABI needs to be added to accommodate a change in language behaviour.
[Bug c++/81239] std::__cxx11::string& visible in gcc warning output
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81239 --- Comment #9 from Jonathan Wakely --- It's the ABI that meets the requirements of the C++11 standard, but that doesn't mean it's enabled by the -std=c++11 flag. The -std flags never change ABI, irrespective of the names used for attributes and namespaces.
[Bug c++/81239] std::__cxx11::string& visible in gcc warning output
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81239 --- Comment #8 from Jonny Grant --- (In reply to Jonathan Wakely from comment #7) > (In reply to Jonny Grant from comment #5) > > (In reply to Jonathan Wakely from comment #4) > > > I fixed the std::__cxx11::string case on trunk, the output is now: > > > > Great! > > > > I wonder how this looks now with -std=c++14or -std=c++17 > > Identical. > > > (not sure why I still saw __cxx11 with both of these with my g++ 8.2.0 > > Because that namespace has absolutely nothing to do with any -std flag. > > https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html Ah ok, that makes sense now. I wonder how many people also confused by that. It is a shame the GCC team did not give the namespace the name __abi11 instead, as __cxx11 is just too similar to the C/C++ std names and gives an opportunity for confusion. If it happens again, would __abi be considered please. Jonny
[Bug c++/81239] std::__cxx11::string& visible in gcc warning output
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81239 --- Comment #7 from Jonathan Wakely --- (In reply to Jonny Grant from comment #5) > (In reply to Jonathan Wakely from comment #4) > > I fixed the std::__cxx11::string case on trunk, the output is now: > > Great! > > I wonder how this looks now with -std=c++14or -std=c++17 Identical. > (not sure why I still saw __cxx11 with both of these with my g++ 8.2.0 Because that namespace has absolutely nothing to do with any -std flag. https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html
[Bug c++/81239] std::__cxx11::string& visible in gcc warning output
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81239 --- Comment #6 from Jonny Grant --- > I imagine you may have found out that this goes away if the "const" is > removed. So it becomes > void test_params(string & mystr1, string & out_str) To add, by this I mean the std:: namespace is visible, providing the parameter is not const
[Bug c++/81239] std::__cxx11::string& visible in gcc warning output
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81239 --- Comment #5 from Jonny Grant --- (In reply to Jonathan Wakely from comment #4) > I fixed the std::__cxx11::string case on trunk, the output is now: Great! I wonder how this looks now with -std=c++14or -std=c++17 (not sure why I still saw __cxx11 with both of these with my g++ 8.2.0 [..] > The error: line shows the namespace for one parameter and not the other: > > 81239.cc: In function 'int main()': > 81239.cc:16:15: error: too few arguments to function 'void test_params(const > cfoo&, a::b::cfoo&)' >16 | test_params(); > | ^ > 81239.cc:10:6: note: declared here >10 | void test_params(const cfoo&, cfoo&) > | ^~~ I imagine you may have found out that this goes away if the "const" is removed. So it becomes void test_params(string & mystr1, string & out_str)
[Bug c++/81239] std::__cxx11::string& visible in gcc warning output
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81239 Jonathan Wakely changed: What|Removed |Added Last reconfirmed|2017-06-28 00:00:00 |2018-12-17 --- Comment #4 from Jonathan Wakely --- I fixed the std::__cxx11::string case on trunk, the output is now: 81239.cc: In function 'int main()': 81239.cc:15:17: error: too few arguments to function 'void test_params(const string&, std::string&)' 15 | test_params(); | ^ 81239.cc:7:6: note: declared here 7 | void test_params(const string & mystr1, string & out_str) | ^~~ However the problem still exists in general: namespace a { inline namespace b { template class foo { }; using cfoo = foo; } } using namespace a; void test_params(const cfoo&, cfoo&) { } int main (void) { test_params(); } The error: line shows the namespace for one parameter and not the other: 81239.cc: In function 'int main()': 81239.cc:16:15: error: too few arguments to function 'void test_params(const cfoo&, a::b::cfoo&)' 16 | test_params(); | ^ 81239.cc:10:6: note: declared here 10 | void test_params(const cfoo&, cfoo&) | ^~~
[Bug c++/81239] std::__cxx11::string& visible in gcc warning output
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81239 --- Comment #3 from Jonny Grant --- (In reply to Jonny Grant from comment #2) > Created attachment 44492 [details] > Better test case wrong ticket. please ignore
[Bug c++/81239] std::__cxx11::string& visible in gcc warning output
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81239 --- Comment #2 from Jonny Grant --- Created attachment 44492 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44492&action=edit Better test case
[Bug c++/81239] std::__cxx11::string& visible in gcc warning output
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81239 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2017-06-28 Ever confirmed|0 |1 --- Comment #1 from Jonathan Wakely --- (In reply to Jon Grant from comment #0) > I noticed that with, or without -std=c++11 on gcc params, the output of > std::string for references still shows __cxx11. for const ref, it isn't > shown in the warning. Confirmed, they should be consistent. > The later warning is ok main.cpp:10:6 That's because it just displays the original source code.