[llvm-bugs] [Bug 33588] Recursive variable template function abnormal behaviour when in namespace

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jun 25 15:47:12 PDT 2017


Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |INVALID

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
This is an MSVC bug, due to their missing / incorrect implementation of
two-phase name lookup.

Within the second definition of f:

    template <std::size_t x, typename ... Args>
    auto f(const M<x>& , Args && ... args)
        return f(args...);

... the third 'f' has not yet been declared and thus is not found by
unqualified name lookup. So once the recursion reaches this overload, it can
never "go back" to the third overload.

If the namespace is removed, the third overload can be found by
argument-dependent name lookup.

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/20170625/ae331b04/attachment.html>

More information about the llvm-bugs mailing list