https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115121
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|++this is accepted in |++const_dependent_ptr is |uninstantiated template |accepted in uninstantiated | |template --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Slightly different testcase (without using this) which shows the issue: ``` template<typename T> int f() { T t = 0; T *const t1 = &t; int t2 = 0; int *const t3 = &t2; ++t1; //++t3; return 0; } //const int t = f<int>(); ``` This should be rejected as pointer can't have an overload for operator++ even if the pointer type has a dependent type. GCC does reject `++t3;` but not `++t1;` at definition time.