http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48665
Summary: type of const member function
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
typeid reports void() and void()const as the same type:
#include <typeinfo>
#include <iostream>
template<class A,class B> void f(){
std::cout << std::boolalpha << (typeid(A)==typeid(B)) << '\n';
}
int main(){
f<void()const,void()>();
}
The demangler in binutils prints void()const as void( const)(). If I make g++
produce an error message (adding a line "typename A::x y;" in f), 4.5 prints
void()const while 4.6 prints void()__attribute__((const)).