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

            Bug ID: 43006
           Summary: NRVO does not happen for template function with return
                    type deduction
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: nok.ra...@gmail.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

struct X
{
    X();
    X(X&&);
};

template <int>
decltype(auto) foo()
{
    X x;
    return x;
}

template decltype(auto) foo<0>();


GCC and MSVC does not have such a limitation https://gcc.godbolt.org/z/dSWI4m

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to