[llvm-bugs] [Bug 24779] New: problem in tuple implementation using non-default-constructible arguments.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 10 14:06:05 PDT 2015


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

            Bug ID: 24779
           Summary: problem in tuple implementation using
                    non-default-constructible arguments.
           Product: libc++
           Version: 3.7
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: bayoubengal at mac.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

clang version used: Apple LLVM version 7.0.0 (clang-700.0.72)  (xcode 7 GM)

However, mclow confirms it fails on ToT too. The code works in prior versions
of clang and gcc.



#include <iostream>
#include <memory>
#include <tuple>

class cHandlerDesc
{
   public:

   static void handleModificationSuspensionTokenRelease(cHandlerDesc* thePtr)
   {

   }

};

void f(cHandlerDesc *)
{


}

using entry_type = std::unique_ptr<cHandlerDesc, decltype(&f)> ;//void (*)
(cHandlerDesc*) >; //decltype(&f)




int main(int argc, const char * argv[])
{
   entry_type tmpU(nullptr, &f);
   std::tuple<entry_type> tmpT( entry_type(nullptr, &f) ); //<--will compile
   std::tuple<entry_type, entry_type> tmpT2( entry_type(nullptr, &f),
entry_type(nullptr, &f) ); //<--won't compile due to static assert



   // insert code here...
   //std::cout << "Hello, World!\n";
    return 0;
}

-- 
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/20150910/e6fe8329/attachment.html>


More information about the llvm-bugs mailing list