This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/35637] [4.3 Regression] tr1::function fails with const member function pointer
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Mar 2008 23:54:19 -0000
- Subject: [Bug libstdc++/35637] [4.3 Regression] tr1::function fails with const member function pointer
- References: <bug-35637-13405@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from manu at gcc dot gnu dot org 2008-03-20 23:54 -------
OK. I see now what the problem is: -pedantic nothing, -pedantic-errors gives an
error. The pedantic warning is in a system header, so it doesn't get emitted.
When using -pedantic-errors, it is an error, so it gets through. This is an
issue also for the C front-end that nobody noticed until now. The problem is in
diagnostics.c (diagnostic_report_diagnostic) which tests for DK_WARNING whether
they are inhibited by -w or within system headers, while pedwarn() is passing a
DK_ERROR when -pedantic-errors is enabled.
In my opinion, neither should give diagnostics for system headers unless
requested (so I would add -Wsystem-headers to your testcases). The fix is that
pedwarn() always passes a DK_WARNING type, while -pedantic-errors reclassifies
-pedantic warnings to emit errors. In other words, -pedantic-errors would
behave internally like -Werror=pedantic.
I don't have time to work on this (or anything else in GCC) at the moment but I
will keep it in my TODO list. Again, I would recommend adding -Wsystem-headers
to your testcases to get diagnostics about system headers.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35637