[Bug c++/59554] Errors with const and volatile in templates.
isak50 at mail dot ru
gcc-bugzilla@gcc.gnu.org
Thu Dec 19 05:36:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59554
--- Comment #2 from Pavel <isak50 at mail dot ru> ---
if i edit code so:
template <typename _T>
void show(_T t)
{
*t = nullptr; // added
printf("----------_T------------\n");
mis_const<_T>::ch();
mis_volatile<_T>::ch();
mis_pointer<_T>::ch();
printf("------decltype(t)-------\n");
mis_const<decltype(t)>::ch();
mis_volatile<decltype(t)>::ch();
mis_pointer<decltype(t)>::ch();
}
i receive error:
C:\TDM\msys\1.0\prg\t>make -s
../source.cpp: In instantiation of 'void show(_T) [with _T = const volatile
int*
]':
../source.cpp:43:11: required from here
../source.cpp:26:12: error: assignment of read-only location '* t'
*t = nullptr;
Pay attention: [with _T = const volatile int*]
More information about the Gcc-bugs
mailing list