In the attached code, the parser gets confused by a use of operator< in the body of a function template. If the operator is changed (to ">" or "==" for example) the code compiles. I've not been able to figure out why it thinks it's in a constant expression. Changing the variable names involved doesn't make a difference, so it doesn't see to be a consequence of name clashes. Ivan
Created attachment 8321 [details] Compiler output (-v -save-temps)
Created attachment 8322 [details] Source code (-save-temps) (compressed)
Hmm, this is the reduced testcase (but I don't know if this is invalid as Comeau also rejects it but I think it is valid): template<typename> int nick(int e); template<int> struct operation{int nick;}; template<int s> bool alphaMnemonic(const operation<s>& o1, const operation<s>& o2) { return o1.nick < o2.nick; } If nick was not a template or not declated we accept it, if alphaMnemonic is not a template we accept it. I think we have a name lookup problem really. if we want o1.nick as a template we need the template keyword. This is not a regression if this is valid code, I really think it is. ICC 8.0 accepts it.
There is another PR about exactly this problem somewhere.
Sorry, I'll try to be more original in my PRs :-)
Don't worry, I'm just trying to tighten the net of PRs somehow -- if someone comes around to fix this PR, she might take a little more time than I have right now to find that duplicate PR...
*** Bug 24939 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of 10200 ***
*** Bug 46839 has been marked as a duplicate of this bug. ***