[llvm-bugs] [Bug 35204] New: std::chrono exception specification of explicitly defaulted default constructor does not match the calculated one

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Nov 4 03:16:44 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=35204

            Bug ID: 35204
           Summary: std::chrono exception specification of explicitly
                    defaulted default constructor does not match the
                    calculated one
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jvapen at gmail.com
                CC: llvm-bugs at lists.llvm.org

Hello all,

it seems to be that the following code is accepted by MSVC while clang gives an
error on the same thing.

#include <atomic>
#include <chrono>

struct A {
   std::atomic<std::chrono::time_point<std::chrono::system_clock>> t{};
};



"clang-cl.exe" -fms-compatibility-version=19 -Werror -Weverything
-Wno-c++98-compat   /EHsc  t.cpp 


"cl.exe"  /EHsc  t.cpp

exception specification of explicitly defaulted default constructor does not
match the calculated one



In file included from t.cpp:1:
\Vs2015\VC\include\atomic(513,2):  error: exception specification of explicitly
defaulted default
      constructor does not match the calculated one
        _Atomic_base() _NOEXCEPT = default;
        ^
\Vs2015\VC\include\atomic(668,5):  note: in instantiation of template class
      'std::_Atomic_base<std::chrono::time_point<std::chrono::system_clock,
std::chrono::duration<long long,
      std::ratio<1, 10000000> > >, 8>' requested here
                : _Atomic_base<_Ty, sizeof (_Ty)>
                  ^
t.cpp(5,68):  note: in instantiation of template class
'std::atomic<std::chrono::time_point<std::chrono::system_clock,
      std::chrono::duration<long long, std::ratio<1, 10000000> > > >' requested
here
   std::atomic<std::chrono::time_point<std::chrono::system_clock>> t{};

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171104/50b12af3/attachment-0001.html>


More information about the llvm-bugs mailing list