aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2020-06-23 12:20:26 +0100
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 13:14:34 -0300
commit691f47153bc1e2da5cfe9c905ad42028b52b0e47 (patch)
tree103103420edd2c81e7c0560bfdfd9b754ab8a7c1
parente634470aa2e523644cc9b79f15c1aaa485434f72 (diff)
downloadgcc-691f47153bc1e2da5cfe9c905ad42028b52b0e47.zip
gcc-691f47153bc1e2da5cfe9c905ad42028b52b0e47.tar.gz
gcc-691f47153bc1e2da5cfe9c905ad42028b52b0e47.tar.bz2
libstdc++: Adjust std::from_chars negative tests
Also test with an enumeration type. Move the dg-error directives outside the #if block, because DejaGnu would process them whether or not wchar_t support is present. libstdc++-v3/ChangeLog: * testsuite/20_util/from_chars/1_c++20_neg.cc: Check enumeration type. * testsuite/20_util/from_chars/1_neg.cc: Likewise. Move dg-error directives outside preprocessor condition.
-rw-r--r--libstdc++-v3/testsuite/20_util/from_chars/1_c++20_neg.cc3
-rw-r--r--libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc8
2 files changed, 10 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/20_util/from_chars/1_c++20_neg.cc b/libstdc++-v3/testsuite/20_util/from_chars/1_c++20_neg.cc
index 8a73b2d..8454b30 100644
--- a/libstdc++-v3/testsuite/20_util/from_chars/1_c++20_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/from_chars/1_c++20_neg.cc
@@ -35,6 +35,9 @@ test01(const char* first, const char* last)
char32_t c32;
std::from_chars(first, last, c32); // { dg-error "no matching" }
std::from_chars(first, last, c32, 10); // { dg-error "no matching" }
+ enum E { } e;
+ std::from_chars(first, last, e); // { dg-error "no matching" }
+ std::from_chars(first, last, e, 10); // { dg-error "no matching" }
}
// { dg-prune-output "enable_if" }
diff --git a/libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc b/libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc
index 3f46b7e..12b5e59 100644
--- a/libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc
@@ -25,9 +25,11 @@ test01(const char* first, const char* last)
{
#if _GLIBCXX_USE_WCHAR_T
wchar_t wc;
+#else
+ enum W { } wc;
+#endif
std::from_chars(first, last, wc); // { dg-error "no matching" }
std::from_chars(first, last, wc, 10); // { dg-error "no matching" }
-#endif
char16_t c16;
std::from_chars(first, last, c16); // { dg-error "no matching" }
@@ -35,6 +37,10 @@ test01(const char* first, const char* last)
char32_t c32;
std::from_chars(first, last, c32); // { dg-error "no matching" }
std::from_chars(first, last, c32, 10); // { dg-error "no matching" }
+
+ enum E { } e;
+ std::from_chars(first, last, e); // { dg-error "no matching" }
+ std::from_chars(first, last, e, 10); // { dg-error "no matching" }
}
// { dg-prune-output "enable_if" }