work around GCC bug 108860
GCC 12/13/14 can emit spurious warnings for something as innocent as vec.insert(vec.begin(), 12)... Reported by Antoine Martin and Quentin Rataud. * m4/gccwarn.m4: Test the above code and disable GCC's -Wnull-dereference warning if necessary.
This commit is contained in:
parent
fdb09f787e
commit
c7c18db6db
1 changed files with 8 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ AC_DEFUN([CF_GXX_WARNINGS],
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line __oline__ "configure"
|
#line __oline__ "configure"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
|
||||||
// From GCC bug 106159
|
// From GCC bug 106159
|
||||||
|
|
@ -29,6 +30,13 @@ struct left { virtual ~left() {} };
|
||||||
struct right { virtual ~right() {} };
|
struct right { virtual ~right() {} };
|
||||||
struct both: public left, public right {};
|
struct both: public left, public right {};
|
||||||
|
|
||||||
|
// For GCC bug 108860
|
||||||
|
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108860
|
||||||
|
void test(std::vector<int>& v)
|
||||||
|
{
|
||||||
|
v.insert(v.begin(), 12);
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[[]])
|
int main(int argc, char *argv[[]])
|
||||||
{
|
{
|
||||||
// This string comparison is here to detect superfluous
|
// This string comparison is here to detect superfluous
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue