[llvm-bugs] [Bug 29312] New: Incorrect handling of ambiguous typed std::get(std::tuple)

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 29 06:22:43 PDT 2016


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

            Bug ID: 29312
           Summary: Incorrect handling of ambiguous typed
                    std::get(std::tuple)
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jakub.gargul at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Program using typed std::get is required to be ill-formed when retrieved type
occurs more than once inside a tuple:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3584.html
Instead following code compiles successfully in clang++ 3.8.0 choosing the
first matching type:

#include <iostream>
#include <tuple>


int main() 
{
    std::tuple<int, int> tup{59, 56};

    std::cout << std::get<int>(tup) << std::endl;

    return 0;
}

std::pair exhibits proper behavior and doesn't compile with ambiguous std::get.

-- 
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/20160829/83179d71/attachment.html>


More information about the llvm-bugs mailing list