[cfe-dev] Explicit instantiation with body?

Serge Pavlov sepavloff at gmail.com
Wed Jun 19 09:47:44 PDT 2013


There is close problem: http://llvm.org/bugs/show_bug.cgi?id=15466 - clang
accepts incorrect explicit instantiation, but it is about type templates.


2013/6/19 Larisse Voufo <lvoufo at google.com>

> Just out of curiosity, I have noticed that Clang currently allows the
> following program:
>
> template<typename T> T f() { return 13; }
> template int f() { return 1; }
>
> It essentially parses the body of the explicit instantiation only to
> ignore it.
> Was this a conscious decision?
>
> GCC 4.6.3 rejects the program with "expected ‘;’ before ‘{’ token".
>
> Thanks,
> -- Larisse.
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>


-- 
Thanks,
--Serge
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130619/3b227f09/attachment.html>


More information about the cfe-dev mailing list