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

            Bug ID: 44468
           Summary: Cannot access members of temporary objects created via
                    CTAD
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++17
          Assignee: unassignedclangb...@nondot.org
          Reporter: tony.wasse...@gmx.de
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

When creating temporary objects of deduced template argument type, clang fails
to compile a program that attempts to access a member of the created object.
Example: `MyTemplate { t }.a`.

A workaround is to wrap the created object in an std::move, like
`std::move(MyTemplate { t }).a`.

Interestingly, this issue only seems to happen when the constructor argument
itself is a dependent name.

Full example: https://godbolt.org/z/Tj6TC7 . GCC and MSVC consider this example
valid.

-- 
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