Bug in template parsing?
Marcel Keller
M.Keller@bristol.ac.uk
Tue Jun 14 21:27:00 GMT 2016
Hi,
Trying to compile the attached code with GCC 5.3.0 gives the error:
templ_bug.cpp: In function âvoid g()â:
templ_bug.cpp:15:12: error: expected primary-expression before â)â token
T().f<t>();
^
templ_bug.cpp: In instantiation of âvoid g() [with T = A; int t = 0]â:
templ_bug.cpp:19:10: required from here
templ_bug.cpp:15:8: error: invalid operands of types â<unresolved
overloaded function type>â and âintâ to binary âoperator<â
T().f<t>();
^
However, if I uncomment the commented line, it works fine. I cannot
understand why this should make a difference. Is there a mistake in the
code or a bug in GCC?
Best regards,
Marcel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: templ_bug.cpp
Type: text/x-c++src
Size: 240 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20160614/5ba258ce/attachment.bin>
More information about the Gcc-help
mailing list