e3dbe7a07c
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:
|
||
---|---|---|
.. | ||
editor | ||
3d.h | ||
args.h | ||
byteutil.h | ||
compiler-addressof.h | ||
compiler-array.h | ||
compiler-begin.h | ||
compiler-exchange.h | ||
compiler-integer_sequence.h | ||
compiler-lengthof.h | ||
compiler-make_unique.h | ||
compiler-range_for.h | ||
compiler-static_assert.h | ||
compiler-type_traits.h | ||
console.h | ||
countarray.h | ||
digi_audio.h | ||
digi_mixer.h | ||
digi_mixer_music.h | ||
dxxerror.h | ||
event.h | ||
fmtcheck.h | ||
func.h | ||
fwd-gr.h | ||
fwd-partial_range.h | ||
fwdvalptridx.h | ||
gr.h | ||
grdef.h | ||
hash.h | ||
highest_valid.h | ||
hmp.h | ||
iff.h | ||
ignorecase.h | ||
internal.h | ||
interp.h | ||
joy.h | ||
jukebox.h | ||
key.h | ||
loadgl.h | ||
makesig.h | ||
maths.h | ||
messagebox.h | ||
mouse.h | ||
ntstring.h | ||
null_sentinel_iterator.h | ||
ogl_extensions.h | ||
ogl_init.h | ||
ogl_sync.h | ||
pack.h | ||
palette.h | ||
partial_range.h | ||
pcx.h | ||
physfs-serial.h | ||
physfs_list.h | ||
physfsx.h | ||
poison.h | ||
pstypes.h | ||
rbaudio.h | ||
reverse.h | ||
rle.h | ||
serial.h | ||
strutil.h | ||
texmap.h | ||
timer.h | ||
u_mem.h | ||
ui.h | ||
valptridx.h | ||
varutil.h | ||
vecmat.h | ||
window.h |