[Bug c++/17166] g++ 3.4.1 and 3.5 forget a template function definition
bangerth at dealii dot org
gcc-bugzilla@gcc.gnu.org
Tue Aug 24 18:26:00 GMT 2004
------- Additional Comments From bangerth at dealii dot org 2004-08-24 18:26 -------
With Volker's analysis, this is the minimal testcase:
--------------
template <typename T> int foo (T);
enum {e};
int i = foo(e);
--------------
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc:3: error: no matching function for call to `foo(<anonymous enum>)'
Giving the enum a name makes the compiler accept the code.
The question here, I guess, is this: if unnamed enums can't be template
arguments, what does this imply? Is this a substitution failure that leads
to the silent removal of said function from the overload set? This is how
gcc treats things. Or should this lead to some kind of error message? The
normative sentence 14.3.1/2 doesn't state this and I can't find any other
sentence at present.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17166
More information about the Gcc-bugs
mailing list