[Bug c++/77812] [5/6/7 Regression] incorrectly rejects valid C++ code that uses enum in template instantiation
nathan at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jan 11 17:30:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77812
--- Comment #3 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
The struct variant only 'works' because 'struct X' is a valid incomplete struct
declaration. Try:
struct f {};
template <typename>
void f ()
{
struct f Q;
}
template void f<int> ();
void f() void f() [with <template-parameter-1-1> = int]
../../../77812-struct.ii: In instantiation of 'void f() [with
<template-parameter-1-1> = int]':
../../../77812-struct.ii:9:23: required from here
../../../77812-struct.ii:6:12: error: 'f() [with <template-parameter-1-1> =
int]::f Q' has incomplete type
struct f Q;
^
More information about the Gcc-bugs
mailing list