This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/64509] _Generic throws error in unselected generic association
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 06 Jan 2015 18:16:37 +0000
- Subject: [Bug c/64509] _Generic throws error in unselected generic association
- Auto-submitted: auto-generated
- References: <bug-64509-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64509
--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
_Generic is intended for cases like <tgmath.h>, where calls to all
functions are still valid for all argument types. This is a case where
the expression __f(S) violates a constraint, and that constraint applies
to all function calls, not just evaluated ones - this is just the same as
a constraint violation inside if (0), or if
(expression_that_evaluates_to_0_at_runtime). (It's also required that
functions called in unevaluated generic associations are defined somewhere
in the program; only sizeof and _Alignof have exemptions from that.)