https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10200
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2016-01-22 00:00:00 |2016-2-8
--- Comment #32 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The new testcase gets two errors (both due to treating "q->exp< N" as the start
of a template) and Manu's suggestion in comment 30 only helps with the second
one.
Slightly further reduced (the macro shows how in gcc-5 this bug was only
encountered by using <cmath> and using std::exp, but in gcc 6 it's also
encountered with <math.h> because that now has the using declaration):
namespace std {
template<typename T> T exp(T t) { return t; }
}
#ifndef NO_USING
using std::exp;
#endif
template <typename> class A {
struct B { long exp; };
void m_fn1();
};
template <typename Key> void A<Key>::m_fn1() {
long insert_exp = 1;
B q;
(q->exp < insert_exp);
}
exp.cc: In member function ‘void A< <template-parameter-1-1> >::m_fn1()’:
exp.cc:16:13: error: the value of ‘insert_exp’ is not usable in a constant
expression
(q->exp < insert_exp);
^
exp.cc:14:8: note: ‘long int insert_exp’ is not const
long insert_exp = 1;
^
exp.cc:16:7: error: parse error in template argument list
(q->exp < insert_exp);
^