[LLVMbugs] [Bug 18662] New: clang tries to match exception specification for an explictly defaulted but implicitly deleted function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jan 29 15:34:23 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18662

            Bug ID: 18662
           Summary: clang tries to match exception specification for an
                    explictly defaulted but implicitly deleted function
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: st at quanttec.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following example seems to fail to compile because clang tries to match the
exception specification for the explicitly defaulted but implicitly deleted
move assignment operator of Wrapper with a bogus exception specification it
calculated for the implicitly deleted function.

--
class Value {
public:
  Value();
  Value& operator=(const Value& other);
  Value& operator=(Value&& other) noexcept;
};

template <typename T>
struct Wrapper {
   T value;

   Wrapper& operator=(const Wrapper&) = default;
   Wrapper& operator=(Wrapper&&) noexcept = default;
};

Wrapper<const Value> value;
--

lang++ -std=c++11 test.cpp
test.cpp:13:13: error: exception specification of explicitly defaulted move
assignment operator does not match the calculated one
   Wrapper& operator=(Wrapper&&) noexcept = default;
            ^
test.cpp:16:22: note: in instantiation of template class 'Wrapper<const Value>'
requested here
Wrapper<const Value> value;
                     ^
1 error generated.

-- 
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/20140129/0a1edce6/attachment.html>


More information about the llvm-bugs mailing list