This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17166] g++ 3.4.1 and 3.5 forget a template function definition


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]