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/80868] "Duplicate const" warning emitted in `const typeof(foo) bar;`


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80868

--- Comment #3 from George Burgess IV <george.burgess.iv at gmail dot com> ---
Thanks for the response!

From the standpoint of consistency, I agree.

My point is more that GCC isn't bound by the standard to be as strict with
`typeof`, and making an exception for `typeof` here would make it easier to use
in macros. I believe the gain in usability here outweighs the cost of having
this inconsistency.

(I also feel that this warning in general isn't useful when the only
"duplicate" const has been inferred from an expression, but it seems that
__auto_type has the same "duplicate const" behavior as typeof, so...)

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