In gcc-4.7, a type inherited via using is distinct from a type defined
by using.
$ cat t.cpp
template <typename>
class A
{
public:
typedef void a;
typedef void b;
};
template <typename T>
class B : protected A<T>
{
protected:
using typename A<T>::a;
using b = typename A<T>::b;
public:
static inline a f1();
static inline b f2();
};
template <typename T>
typename B<T>::a B<T>::f1() {} // fails for gcc-4.7, works in later
template <typename T>
typename B<T>::b B<T>::f2() {} // works in both
$ gcc-4.7 -Wall -Wextra -std=gnu++0x -O2 -c t.cpp
t.cpp:21:18: error: prototype for 'typename B<T>::a B<T>::f1()' does not match any in class 'B<T>'
t.cpp:16:18: error: candidate is: static typename A<T>::a B<T>::f1()
t.cpp:16:18: warning: inline function 'static typename A<T>::a B<T>::f1() [with T = int; typename A<T>::a = void]' used but never defined [enabled by default]
$ gcc-4.8 -Wall -Wextra -std=gnu++0x -O2 -c t.cpp
$
Fixes: 8b7c5c3e2b ("Rewrite valptridx")
Most call sites use unqualified begin/end and rely on using declarations
to pick an appropriate implementation. Fix the sites that explicitly
requested std::begin/std::end.
gcc-4.7 (and, if constructor inheritance is suppressed, later versions)
reject
return objnum == object_none ? vcobjptr(static_cast<objnum_t>(object_first)) : objnum;
where objnum is a cobjptridx:
similar/main/digiobj.cpp: In lambda function:
similar/main/digiobj.cpp:564:85: error: operands to ?: have different types 'valptridx<object>::vcptr' and 'valptridx<object>::cptridx'
similar/main/digiobj.cpp:564:85: error: inconsistent types '<type error>' and 'valptridx<object>::vcptr' deduced for lambda return type
Fix it by removing the ternary operator and adding an appropriate
conversion cast.
In gcc-4.7, <bits/hashtable.h> uses static_assert in a way that the
preprocessor considers to have 3 arguments. Move render_state.h up to
ensure that <bits/hashtable.h> is included before
"compiler-static_assert.h" converts static_assert into a 2 argument
macro.