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/64509] _Generic throws error in unselected generic association


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.)


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