language: C++ 4.7.2 (gcc-4.7.2)
date: 669 days 13 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
template <typename T>
struct type_name_is {};
 
template <typename T>
void type_name_error(const T&)
{
    // will error with type name:
    type_name_is<T>::showing_type_name();
}
 
int main()
{
    type_name_error(42u + -43);
}
 
prog.cpp: In function ‘void type_name_error(const T&) [with T = unsigned int]’:
prog.cpp:13:   instantiated from here
prog.cpp:8: error: ‘showing_type_name’ is not a member of ‘type_name_is<unsigned int>’
Will display exact type in diagnostic.