[Bug c/80868] "Duplicate const" warning emitted in `const typeof(foo) bar;`
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed May 24 10:43:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80868
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
We're supposed to complain for
const const int x;
and
typedef const int t;
const t x;
and I think we should thus also warn for this (-std=gnu89 -pedantic only).
const int a;
const __typeof(a) x;
because __typeof() doesn't strip outermost type qualifications. There were
discussion about adding __nonqual_typeof() but that hasn't been added yet.
More information about the Gcc-bugs
mailing list