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++/48883] ?: ternary operator fails in certain contexts - link error


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48883

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.05.05 12:15:05
     Ever Confirmed|0                           |1

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-05-05 12:15:05 UTC ---
reduced:

template<typename T>
T myMax(T a, T b) {
   if(a < b) return a;
   return b;
}

int main() {
   bool even = true;
   int (*fp)(int, int);
   fp = even ? myMax<int> : myMax<int>;   /* yields link error */
}


The function template specialization should be implicitly instantiated


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