[LLVMbugs] [Bug 18628] Crash during compilation of union-like class with template method which has auto return value

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 27 08:39:14 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18628

Reid Kleckner <rnk at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |rnk at google.com
         Resolution|---                         |WORKSFORME

--- Comment #1 from Reid Kleckner <rnk at google.com> ---
Thanks for the report.  This looks like a bug that's been fixed since 3.3,
though.  My clang from last week says:

$ clang -c C:/Users/rnk/Downloads/main.cpp -std=c++11 -o t.obj
C:/Users/rnk/Downloads/main.cpp:38:9: error: templates cannot be declared
inside of a local class
        template<typename T>
        ^~~~~~~~~~~~~~~~~~~~
C:/Users/rnk/Downloads/main.cpp:46:8: error: no matching member function for
call to 'visit'
    d1.visit(bool_visitor());
    ~~~^~~~~
C:/Users/rnk/Downloads/main.cpp:22:10: note: candidate template ignored:
substitution failure [with VisitorType = bool_visitor]: no member named 'visit'
in 'bool_visitor'
    auto visit(const VisitorType &visitor) const
         ^
2 errors generated.

Moving bool_visitor to global scope lets it compile successfully.

-- 
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/20140127/3b988f85/attachment.html>


More information about the llvm-bugs mailing list