[LLVMbugs] [Bug 10173] New: Clang asserts/crashes when compiling static member function with late-specified return type

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jun 22 18:20:34 PDT 2011


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

           Summary: Clang asserts/crashes when compiling static member
                    function with late-specified return type
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: james at jamesmcnellis.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


(Using clang version 3.0 (trunk 133044) / i686-pc-mingw32)

Clang crashes when compiling the following trivial program:

    struct S
    {
        template <typename T>
        static auto f() -> void { }
    };

c:\dev>clang++ -std=c++0x stubby.cpp
Assertion failed: isa<X>(Val) && "cast<Ty>() argument of incompatible type!",
file C:\dev\tools\clang_trunk\llvm\include/llvm/Support/Casting.h, line 194

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
clang++: error: clang frontend command failed with exit code 3 (use -v to see
invocation)

-------------------------------------------------------
If we make 'f' a nontemplate static member function, Clang just gets confused:

    struct S 
    { 
        static auto f() -> void { } 
    };

c:\dev>clang++ -std=c++0x stubby.cpp
stubby.cpp:3:17: error: declaration of variable 'f' with type 'void ()'
requires an initializer
    static auto f() -> void { }
                ^
1 error generated.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list