[PATCH 1/2] PR c++/91436 fix C++ dialect for std::make_unique fix-it hint

Jonathan Wakely jwakely@redhat.com
Wed Aug 14 11:16:00 GMT 2019


On 13/08/19 16:07 -0400, Jason Merrill wrote:
>On 8/13/19 9:32 AM, Jonathan Wakely wrote:
>>     * g++.dg/lookup/missing-std-include-6.C: Don't check make_unique in
>>     test that runs for C++11.
>
>I'm not comfortable removing this test coverage entirely.  Doesn't it 
>give a useful diagnostic in C++11 mode as well?

It does:

mu.cc:3:15: error: 'make_unique' is not a member of 'std'
    3 | auto p = std::make_unique<int>();
      |               ^~~~~~~~~~~
mu.cc:3:15: note: 'std::make_unique' is only available from C++14 onwards
mu.cc:3:27: error: expected primary-expression before 'int'
    3 | auto p = std::make_unique<int>();
      |                           ^~~

So we can add it to g++.dg/lookup/missing-std-include-8.C instead,
which runs for c++98_only and checks for the "is only available for"
cases. Here's a patch doing that.

Tested x86_64-linux.

OK for trunk?

OK for gcc-9-branch and gcc-8-branch too, since PR c++/91436 affects
those branches?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 4144 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190814/b41a552d/attachment.bin>


More information about the Gcc-patches mailing list