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

            Bug ID: 87278
           Summary: GCC 8 fails to compile make_shared<volatile int>()
           Product: gcc
           Version: 8.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jzwinck at gmail dot com
  Target Milestone: ---

This code compiled in GCC prior to 8.0, but fails to compile in GCC 8.1 and
8.2:

    std::make_shared<volatile int>(0)

The error is:

    bits/shared_ptr.h: In instantiation of 'std::shared_ptr<_Tp>
std::make_shared(_Args&& ...) [with _Tp = volatile int; _Args = {int}]':

    bits/shared_ptr.h:718:45: error: no matching function for call to
'std::allocator<volatile int>::allocator()'

Demo: https://godbolt.org/z/rKy3od

Prior discussion:
https://stackoverflow.com/questions/52268878/gcc-8-fails-to-compile-make-sharedvolatile-int

Reply via email to