This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17166] g++ 3.4.1 and 3.5 forget a template function definition
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Aug 2004 18:26:16 -0000
- Subject: [Bug c++/17166] g++ 3.4.1 and 3.5 forget a template function definition
- References: <20040824124058.17166.guillaume.melquiond@ens-lyon.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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