Skip to content

clang fails to reject invalid typeid expression and so crashes later on #9580

@llvmbot

Description

@llvmbot
Bugzilla Link 9208
Resolution FIXED
Resolved on May 09, 2011 18:14
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@RealLitb

Extended Description

#include

template void foo() {};

int main() {
typeid(foo);
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions