https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101783
nick huang <nickhuang99 at hotmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nickhuang99 at hotmail dot com --- Comment #5 from nick huang <nickhuang99 at hotmail dot com> --- Created attachment 51274 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51274&action=edit suggested fix for PR101783 Here is my suggested fix for this bug. The root cause of this bug is that it considers reference with cv qualifier as an error by generating value for variable "bad_quals". However, this is not correct for case of typedef. Here I quote spec: "Cv-qualified references are ill-formed except when the cv-qualifiers are introduced through the use of a typedef-name ([dcl.typedef], [temp.param]) or decltype-specifier ([dcl.type.decltype]), in which case the cv-qualifiers are ignored."