-// { dg-options "-std=gnu++11" }
+// { dg-do run { target c++11 } }
// { dg-require-string-conversions "" }
// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com>
-// Copyright (C) 2008-2015 Free Software Foundation, Inc.
+// Copyright (C) 2008-2024 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
void
test01()
{
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
{
wstring one;
- stoll(one);
+ stoll(one);
}
- catch(std::invalid_argument)
+ catch(const std::invalid_argument&)
{
test = true;
}
try
{
wstring one(L"a");
- stoll(one);
+ stoll(one);
}
- catch(std::invalid_argument)
+ catch(const std::invalid_argument&)
{
test = true;
}
try
{
wstring one(L"a");
- ll1 = stoll(one, 0, 16);
+ ll1 = stoll(one, 0, 16);
}
catch(...)
{
try
{
wstring one(L"78");
- ll1 = stoll(one, &idx1, 8);
+ ll1 = stoll(one, &idx1, 8);
}
catch(...)
{
try
{
wstring one(L"10112");
- ll1 = stoll(one, &idx1, 2);
+ ll1 = stoll(one, &idx1, 2);
}
catch(...)
{
try
{
wstring one(L"0XE");
- ll1 = stoll(one, &idx1, 0);
+ ll1 = stoll(one, &idx1, 0);
}
catch(...)
{
wstring one(1000, L'9');
ll1 = stoll(one);
}
- catch(std::out_of_range)
+ catch(const std::out_of_range&)
{
test = true;
}