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

           Summary: clang fails to reject invalid typeid expression and so
                    crashes later on
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


#include <typeinfo>

template<typename T> void foo() {};

int main() {
    typeid(foo<int>);
}

The above is invalid (at least according to g++) but since clang accepts it
clang tries to generate the type's name using its name mangling logic and
therefore hits the following assert:

Assertion failed: (false && "Overloaded and dependent types shouldn't get to
name mangling"), function mangleType, file ItaniumMangle.cpp, line 1303.

g++'s output is:

typeinfo_assert.c++: In function ‘int main()’:
typeinfo_assert.c++:6: error: insufficient contextual information to determine
type

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to