diff mbox

[v3] partially fix testsuite/27_io/headers/cstdio/types_std.cc

Message ID 20141017122124.GV4197@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely Oct. 17, 2014, 12:21 p.m. UTC
testsuite/27_io/headers/cstdio/types_std.cc FAILs on dragonflybsd:

/mnt/gcc-src/libstdc++-v3/testsuite/27_io/headers/cstdio/types_std.cc:25:13:
error: aggregate 'FILE gnu::f' has incomplete type and cannot be
defined
/mnt/gcc-src/libstdc++-v3/testsuite/27_io/headers/cstdio/types_std.cc:26:13:
error: aggregate 'FILE gnu::fpos_t' has incomplete type and cannot be
defined

These errors look correct to me, the C standard says that <stdio.h>
declares FILE as an object type, but it doesn't say complete object
type, so I think that's a bug in the test.

I think there's another bug:

#include <cstdio>

namespace gnu
{
  std::size_t s;
  std::FILE f;
  std::FILE fpos_t;
}

Surely that third declaration should be testing that fpos_t is a valid
type, rather than declaring a variable of that name, so I'm committing
the attached patch, which also fixes another fail on dragonflybsd.

Tested x86_64-linux, committed to trunk.
diff mbox

Patch

commit c388b3dc00c256c9cc5d8ae7b5bc37386bd14c58
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Oct 17 12:57:31 2014 +0100

    	* testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc:
    	Add dg-require-string-conversions.
    	* testsuite/27_io/headers/cstdio/types_std.cc: Test for fpos_t.

diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc
index 485a485..7fe6ff8 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc
@@ -1,4 +1,5 @@ 
 // { dg-options "-std=gnu++11" }
+// { dg-require-string-conversions "" }
 
 // 2014-03-27 R??diger Sonderfeld
 // test the hexadecimal floating point inserters (facet num_put)
diff --git a/libstdc++-v3/testsuite/27_io/headers/cstdio/types_std.cc b/libstdc++-v3/testsuite/27_io/headers/cstdio/types_std.cc
index a359b87..a34663f 100644
--- a/libstdc++-v3/testsuite/27_io/headers/cstdio/types_std.cc
+++ b/libstdc++-v3/testsuite/27_io/headers/cstdio/types_std.cc
@@ -23,5 +23,5 @@  namespace gnu
 {
   std::size_t s;
   std::FILE f;
-  std::FILE fpos_t;
+  std::fpos_t p;
 }