diff options
author | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2001-02-27 04:28:36 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2001-02-27 04:28:36 +0000 |
commit | 00035ba5e2104263fc55d2888d2852fc66902715 (patch) | |
tree | 219c6f29e00435e03592acefb06605c802789c92 /libstdc++-v3 | |
parent | 0349df29f030a533d0a0dfd1b2db491a49b05436 (diff) | |
download | gcc-00035ba5e2104263fc55d2888d2852fc66902715.tar.gz |
std_stdexcept.h (logic_error::logic_error): Use string object, not reference.
2001-02-26 Benjamin Kosnik <bkoz@redhat.com>
libstdc++/1972
libstdc++/2089
* include/bits/std_stdexcept.h (logic_error::logic_error): Use
string object, not reference.
(runtime_error::runtime_error): Same.
From-SVN: r40082
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/testsuite/19_diagnostics/stdexceptions.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libstdc++-v3/testsuite/19_diagnostics/stdexceptions.cc b/libstdc++-v3/testsuite/19_diagnostics/stdexceptions.cc index ac56b594ab2..6969ae19e95 100644 --- a/libstdc++-v3/testsuite/19_diagnostics/stdexceptions.cc +++ b/libstdc++-v3/testsuite/19_diagnostics/stdexceptions.cc @@ -28,23 +28,23 @@ void test01() { bool test = true; - const char* strlit = "lack of sunlight, no water error"; + std::string s("lack of sunlight, no water error"); // XXX work around long-standing, pathalogical, hostility-inducing parser bug // std::logic_error obj(std::string(strlit)); // 1 - std::logic_error obj = std::logic_error(std::string(strlit)); + std::logic_error obj = std::logic_error(s); // 2 // std::logic_error obj((std::string)strlit); - VERIFY( strcmp(obj.what(), strlit) ); + VERIFY( strcmp(obj.what(), s.data()) ); } void test02() { bool test = true; - std::string s = "lack of sunlight error"; + std::string s("lack of sunlight error"); std::domain_error x(s); VERIFY( strcmp(x.what(), s.data()) ); |