------- Comment #6 from mark at codesourcery dot com 2008-07-08 16:32 ------- Subject: Re: Simple std::bind use causes warnings with -Wextra
paolo dot carlini at oracle dot com wrote: > Thanks Tom. In fact, yesterday I was writing without remembering my past > analyses of this type of issue, with system header warnings not suppressed: > TREE_NO_WARNING is *not* generically uses for that. Everything boils down to > DECL_IN_SYSTEM_HEADER on the decl instead. Why is it reasonable for a libstdc++ header to return a cv-qualified type, but not for user code to do so? In general, the system-header hack is to work around things we don't control; we need to accept weird code in <stdio.h> because the OS distributor controls that, not us. But, if it's not practical for libstdc++ to avoid this warning, then it's probably not practical for users to avoid it either, so then I wonder how beneficial the warning is. On the other hand, I'd expect that libstdc++ could just avoid the warning, by using a traits class to strip the cv-qualifier? Thanks, -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36760