はじめに(Introduction)
N4910 Working Draft, Standard for Programming Language C++
C++ n4910は、ISO/IEC JTC1 SC22 WG21の作業原案(Working Draft)です。
公式のISO/IEC 14882原本ではありません。
ISO/IEC JTC1 SC22 のWG21を含むいくつかのWGでは、可能な限り作業文書を公開し、幅広い意見を求めています。
ISO/IEC JTC1 SC7からISO/IEC JTC1 SC22リエゾンとして、2000年頃、C/C++の品質向上に貢献しようとした活動をしていたことがあります。その頃は、まだISO/IEC TS 17961の原案が出る前です。Cの精神が優勢で、セキュリティ対策は補助的な位置付けでした。ISO/IEC TS 17961の制定と、C/C++のライブラリ類の見直しと、C++の進化はどんどん進んでいきます。
進化の具合が、どちらに行こうとしているかは、コンパイルて実行させてみないとわかりません。C/C++の規格案の電子ファイルは、そのままコンパイルできる形式であるとよいと主張してきました。MISRA-C/C++, CERTC/C++でも同様です。MISRA-C/C++は、Example Suiteという形で、コード断片をコンパイルできる形で提供するようになりました。
一連の記事はコード断片をコンパイルできる形にする方法を検討してコンパイル、リンク、実行して、規格案の原文と処理系(g++, Clang++)との違いを確認し、技術内容を検討し、ISO/IEC JTC1 SC22 WG21にフィードバックするために用います。
また、CERT C++, MISRA C++等のコーディング標準のコード断片をコンパイルする際の参考にさせていただこうと考えています。CERT C++, MISRA C++が標準化の動きとの時間的なずれがあれば確認できれば幸いです。また、boostライブラリとの関連、Linux OS, 箱庭プロジェクト、g++(GCC), clang++(LLVM)との関係も調査中です。
何か、抜け漏れ、耳より情報がありましたらおしらせくださると幸いです。
<この項は書きかけです。順次追記します。>
背景(back ground)
C/C++でコンパイルエラーが出ると、途方にくれることがしばしばあります。
何回かに1回は、該当するエラーが検索できます。
ただ、条件が違っていて、そこでの修正方法では目的を達成しないこともしばしばです。いろいろな条件のコンパイルエラーとその対応方法について、広く記録することによって、いつか同じエラーに遭遇した時にやくに立つことを目指しています。
この半年の間で、三度、自分のネットでの記録に助けられたことがあります。
また過去に解決できなかった記録を10種類以上、最近になって解決できたことがあります。それは、主に次の3つの情報に基づいています。
cpprefjp - C++日本語リファレンス
コンパイラの実装状況
また
https://researchmap.jp/joub9b3my-1797580/#_1797580
に記載したサイトのお世話になっています。
作業方針(sequence)
Clang++では-std=c++03, C++2bの2種類
g++では-std=c++03, c++2bの2種類
でコンパイルし、
1)コンパイルエラーを収集する。
2)コンパイルエラーをなくす方法を検討する。
コンパイルエラーになる例を示すだけが目的のコードは、コンパイルエラーをなくすのではなく、コンパイルエラーの種類を収集するだけにする。
文法を示すのが目的のコード場合に、コンパイルエラーをなくすのに手間がかかる場合は、順次作業します。
3)リンクエラーをなくす方法を検討する。
文法を示すのが目的のコード場合に、リンクエラーをなくすのに手間がかかる場合は、順次作業します。
4)意味のある出力を作る。
コンパイル、リンクが通っても、意味のある出力を示そうとすると、コンパイル・リンクエラーが出て収拾できそうにない場合がある。順次作業します。
1)だけのものから4)まで進んだものと色々ある状態です。一歩でも前に進むご助言をお待ちしています。「検討事項」の欄に現状を記録するようにしています。
C++N4910:2022 Standard Working Draft on ISO/IEC 14882(0) sample code compile list
C++N4741, 2018 Standard Working Draft on ISO/IEC 14882 sample code compile list
C++N4606, 2016符号断片編纂一覧(example code compile list)
C++N4606, 2016 Working Draft 2016, ISO/IEC 14882, C++ standard(1) Example code compile list
https://qiita.com/kaizen_nagoya/items/df5d62c35bd6ed1c3d43/
C++N3242, 2011 sample code compile list on clang++ and g++
編纂器(Compiler)
clang++ --version
Debian clang version 14.0.5-++20220610033153+c12386ae247c-1~exp1~20220610153237.151
Target: x86_64-pc-linux-gnu, Thread model: posix, InstalledDir: /usr/bin
g++- --version
g++ (GCC) 12.1.0 Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
31.8 String-based streams [string.streams] C++N4910:2022 (691) p1539.cpp
算譜(source code)
// C++N4910 Committee Draft, Standard for Programming Language C++
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/n4910.pdf
const char * n4910 = "31.8 String-based streams [string.streams] C++N4910:2022 (691) p1539.cpp";
// Debian clang version 14.0.5-++20220610033153+c12386ae247c-
// g++ (GCC) 12.1.0 Copyright (C) 2022 Free Software Foundation, Inc.
// Edited by Dr. OGAWA Kiyoshi. Compile procedure and results record.
// C++N4910:2022 Standard Working Draft on ISO/IEC 14882(0) sample code compile list
// https://qiita.com/kaizen_nagoya/items/fc957ddddd402004bb91
#include "N4910.h"
using namespace std;
// 31.8.1 [sstream.syn]
String-based streams Header <sstream> synopsis
namespace std {
template<class charT, class traits = char_traits<charT>,
class Allocator = allocator<charT>>
class basic_stringbuf;
template<class charT, class traits, class Allocator>
void swap(basic_stringbuf<charT, traits, Allocator>& x,
basic_stringbuf<charT, traits, Allocator>& y) noexcept(noexcept(x.swap(y)));
using stringbuf = basic_stringbuf<char>;
using wstringbuf = basic_stringbuf<wchar_t>;
template<class charT, class traits = char_traits<charT>,
class Allocator = allocator<charT>>
class basic_istringstream;
template<class charT, class traits, class Allocator>
void swap(basic_istringstream<charT, traits, Allocator>& x,
basic_istringstream<charT, traits, Allocator>& y);
using istringstream = basic_istringstream<char>;
using wistringstream = basic_istringstream<wchar_t>;
template<class charT, class traits = char_traits<charT>,
class Allocator = allocator<charT>>
class basic_ostringstream;
template<class charT, class traits, class Allocator>
void swap(basic_ostringstream<charT, traits, Allocator>& x,
basic_ostringstream<charT, traits, Allocator>& y);
using ostringstream = basic_ostringstream<char>;
using wostringstream = basic_ostringstream<wchar_t>;
template<class charT, class traits = char_traits<charT>,
class Allocator = allocator<charT>>
class basic_stringstream;
template<class charT, class traits, class Allocator>
void swap(basic_stringstream<charT, traits, Allocator>& x,
basic_stringstream<charT, traits, Allocator>& y);
using stringstream = basic_stringstream<char>;
using wstringstream = basic_stringstream<wchar_t>;
}
// The header <sstream> defines four class templates and eight types that associate stream buffers with objects of class basic_string, as described in 23.4.
// 31.8.2 Class template basic_stringbuf [stringbuf]
// 31.8.2.1 General [stringbuf.general]
namespace std {
template<class charT, class traits = char_traits<charT>,
class Allocator = allocator<charT>>
class basic_stringbuf : public basic_streambuf<charT, traits> {
public:
using char_type = charT;
using int_type = typename traits::int_type;
using pos_type = typename traits::pos_type;
using off_type = typename traits::off_type;
using traits_type = traits;
using allocator_type = Allocator;
// 31.8.2.2, constructors
basic_stringbuf() : basic_stringbuf(ios_base::in | ios_base::out) {} explicit basic_stringbuf(ios_base::openmode which);
explicit basic_stringbuf(
const basic_string<charT, traits, Allocator>& s,
ios_base::openmode which = ios_base::in | ios_base::out);
explicit basic_stringbuf(const Allocator& a)
: basic_stringbuf(ios_base::in | ios_base::out, a) {}
basic_stringbuf(ios_base::openmode which, const Allocator& a);
explicit basic_stringbuf(
basic_string<charT, traits, Allocator>&& s,
ios_base::openmode which = ios_base::in | ios_base::out);
template<class SAlloc>
basic_stringbuf(
const basic_string<charT, traits, SAlloc>& s, const Allocator& a)
: basic_stringbuf(s, ios_base::in | ios_base::out, a) {}
template<class SAlloc>
basic_stringbuf(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which, const Allocator& a);
template<class SAlloc>
explicit basic_stringbuf(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which = ios_base::in | ios_base::out);
basic_stringbuf(const basic_stringbuf&) = delete;
basic_stringbuf(basic_stringbuf&& rhs);
basic_stringbuf(basic_stringbuf&& rhs, const Allocator& a);
// 31.8.2.3, assignment and swap
basic_stringbuf& operator=(const basic_stringbuf&) = delete;
basic_stringbuf& operator=(basic_stringbuf&& rhs);
void swap(basic_stringbuf& rhs) noexcept(see below);
// 31.8.2.4, getters and setters
allocator_type get_allocator() const noexcept;
basic_string<charT, traits, Allocator> str() const &;
template<class SAlloc>
basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
basic_string<charT, traits, Allocator> str() &&;
basic_string_view<charT, traits> view() const noexcept;
void str(const basic_string<charT, traits, Allocator>& s);
template<class SAlloc>
void str(const basic_string<charT, traits, SAlloc>& s);
void str(basic_string<charT, traits, Allocator>&& s);
// — ios_base::openmode mode, has in set if the input sequence can be read, and out set if the output sequence can be written.
// — basic_string<charT, traits, Allocator> buf contains the underlying character sequence.
// — init_buf_ptrs() sets the base class’ get area (31.6.3.4.2) and put area (31.6.3.4.3) pointers after initializing, moving from, or assigning to buf accordingly.
protected:
// 31.8.2.5, overridden virtual functions
int_type underflow() override;
int_type pbackfail(int_type c = traits::eof()) override;
int_type overflow (int_type c = traits::eof()) override;
basic_streambuf<charT, traits>* setbuf(charT*, streamsize) override;
pos_type seekoff(off_type off, ios_base::seekdir way,
ios_base::openmode which
= ios_base::in | ios_base::out) override;
pos_type seekpos(pos_type sp,
ios_base::openmode which
= ios_base::in | ios_base::out) override;
private:
ios_base::openmode mode;
basic_string<charT, traits, Allocator> buf;
void init_buf_ptrs();
};
}
// exposition only // exposition only // exposition only
// The class basic_stringbuf is derived from basic_streambuf to associate possibly the input sequence and possibly the output sequence with a sequence of arbitrary characters. The sequence can be initialized from, or made available as, an object of class basic_string.
// For the sake of exposition, the maintained data and internal pointer initialization is presented here as:
// 31.8.2.2 Constructors [stringbuf.cons]
explicit basic_stringbuf(ios_base::openmode which);
// Effects: Initializes the base class with basic_streambuf() (31.6.3.2), and mode with which. It is implementation-defined whether the sequence pointers (eback(), gptr(), egptr(), pbase(), pptr(), epptr()) are initialized to null pointers.
// Postconditions: str().empty() is true.
explicit basic_stringbuf(
const basic_string<charT, traits, Allocator>& s,
ios_base::openmode which = ios_base::in | ios_base::out);
// Effects: Initializes the base class with basic_streambuf() (31.6.3.2), mode with which, and buf with s, then calls init_buf_ptrs().
basic_stringbuf(ios_base::openmode which, const Allocator &a);
// Effects: Initializes the base class with basic_streambuf() (31.6.3.2), mode with which, and buf with a, then calls init_buf_ptrs().
// Postconditions: str().empty() is true.
explicit basic_stringbuf(
basic_string<charT, traits, Allocator>&& s,
ios_base::openmode which = ios_base::in | ios_base::out);
// Effects: Initializes the base class with basic_streambuf() (31.6.3.2), mode with which, and buf with std::move(s), then calls init_buf_ptrs().
template<class SAlloc>
basic_stringbuf(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which, const Allocator &a);
// Effects: Initializes the base class with basic_streambuf() (31.6.3.2), mode with which, and buf with {s,a}, then calls init_buf_ptrs().
template<class SAlloc>
explicit basic_stringbuf(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which = ios_base::in | ios_base::out);
// Constraints: is_same_v<SAlloc, Allocator> is false.
// Effects: Initializes the base class with basic_streambuf() (31.6.3.2), mode with which, and buf with s, then calls init_buf_ptrs(). basic_stringbuf(basic_stringbuf&& rhs);
basic_stringbuf(basic_stringbuf&& rhs, const Allocator& a);
// Effects: Copy constructs the base class from rhs and initializes mode with rhs.mode. In the first form buf is initialized from std::move(rhs).str(). In the second form buf is initialized from {std::move(rhs).str(), a}. It is implementation-defined whether the sequence pointers in *this (eback(), gptr(), egptr(), pbase(), pptr(), epptr()) obtain the values which rhs had.
// Postconditions: Let rhs_p refer to the state of rhs just prior to this construction and let rhs_a refer to the state of rhs just after this construction.
// — str() == rhs_p.str()
// — gptr() - eback() == rhs_p.gptr() - rhs_p.eback()
// — egptr() - eback() == rhs_p.egptr() - rhs_p.eback()
// — pptr() - pbase() == rhs_p.pptr() - rhs_p.pbase()
// — epptr() - pbase() == rhs_p.epptr() - rhs_p.pbase()
// — if (eback()) eback() != rhs_a.eback()
// — if (gptr()) gptr() != rhs_a.gptr()
// — if (egptr()) egptr() != rhs_a.egptr()
// — if (pbase()) pbase() != rhs_a.pbase()
// — if (pptr()) pptr() != rhs_a.pptr()
// — if (epptr()) epptr() != rhs_a.epptr()
// — getloc() == rhs_p.getloc()
// — rhs is empty but usable, as if std::move(rhs).str() was called.
// 31.8.2.3 Assignment and swap [stringbuf.assign]
basic_stringbuf& operator=(basic_stringbuf&& rhs);
// Effects: After the move assignment *this has the observable state it would have had if it had been move constructed from rhs (see 31.8.2.2).
Returns:
*this.
void swap(basic_stringbuf& rhs) noexcept(see below);
// Preconditions: allocator_traits<Allocator>::propagate_on_container_swap::value is true or get_allocator() == rhs.get_allocator() is true.
Effects:
Exchanges the state of *this and rhs.
Remarks:
The exception specification is equivalent to:
allocator_traits<Allocator>::propagate_on_container_swap::value || allocator_traits<Allocator>::is_always_equal::value.
template<class charT, class traits, class Allocator>
void swap(basic_stringbuf<charT, traits, Allocator>& x,
basic_stringbuf<charT, traits, Allocator>& y) noexcept(noexcept(x.swap(y)));
// Effects: Equivalent to: x.swap(y).
// — If ios_base::out is set in mode, pbase() points to buf.front() and epptr() >= pbase() + buf.size() is true;
// — in addition, if ios_base::ate is set in mode, pptr() == pbase() + buf.size() is true,
// — otherwise pptr() == pbase() is true.
// — If ios_base::in is set in mode, eback() points to buf.front(), and (gptr() == eback() && egptr() == eback() + buf.size()) is true.
// [Note 1 : For efficiency reasons, stream buffer operations can violate invariants of buf while it is held encapsulated in the basic_stringbuf, e.g., by writing to characters in the range [buf.data() + buf.size(), buf.data() + buf.capacity()). All operations retrieving a basic_string from buf ensure that the basic_string invariants hold on the returned value. —end note]
// 31.8.2.4 Member functions [stringbuf.members]
// The member functions getting the underlying character sequence all refer to a high_mark value, where high_mark represents the position one past the highest initialized character in the buffer. Characters can be initialized by writing to the stream, by constructing the basic_stringbuf passing a basic_string argument, or by calling one of the str member functions passing a basic_string as an argument. In the latter case, all characters initialized prior to the call are now considered uninitialized (except for those characters re-initialized by the new basic_string).
void init_buf_ptrs(); // exposition only
// Effects: Initializes the input and output sequences from buf according to mode. Postconditions:
allocator_type get_allocator() const noexcept;
// Returns: buf.get_allocator().
basic_string<charT, traits, Allocator> str() const &;
// Effects: Equivalent to:
return basic_string<charT, traits, Allocator>(view(), get_allocator());
template<class SAlloc>
basic_string<charT, traits, SAlloc> str(const SAlloc& sa) const;
// Constraints: SAlloc is a type that qualifies as an allocator (24.2.2.1). Effects: Equivalent to:
return basic_string<charT, traits, SAlloc>(view(), sa);
basic_string<charT, traits, Allocator> str() &&;
// Postconditions: The underlying character sequence buf is empty and pbase(), pptr(), epptr(), eback(), gptr(), and egptr() are initialized as if by calling init_buf_ptrs() with an empty buf.
// Returns: A basic_string<charT, traits, Allocator> object move constructed from the basic_- stringbuf’s underlying character sequence in buf. This can be achieved by first adjusting buf to have the same content as view().
basic_string_view<charT, traits> view() const noexcept;
// Let sv be basic_string_view<charT, traits>.
// Returns: A sv object referring to the basic_stringbuf’s underlying character sequence in buf:
// — If ios_base::out is set in mode, then sv(pbase(), high_mark-pbase()) is returned.
// — Otherwise, if ios_base::in is set in mode, then sv(eback(), egptr()-eback()) is returned. — Otherwise, sv() is returned.
// [Note 2: Using the returned sv object after destruction or invalidation of the character sequence underlying *this is undefined behavior, unless sv.empty() is true.
void str(const basic_string<charT, traits, Allocator>& s);
// Effects: Equivalent to:
buf = s;
init_buf_ptrs();
template<class SAlloc>
void str(const basic_string<charT, traits, SAlloc>& s);
// Constraints: is_same_v<SAlloc,Allocator> is false.
// Effects: Equivalent to:
buf = s;
init_buf_ptrs();
void str(basic_string<charT, traits, Allocator>&& s);
// Effects: Equivalent to: buf = std::move(s);
init_buf_ptrs();
// 31.8.2.5 Overridden virtual functions [stringbuf.virtuals]
int_type underflow() override;
// Returns: If the input sequence has a read position available, returns traits::to_int_type(*gptr()). Otherwise, returns traits::eof(). Any character in the underlying buffer which has been initialized is considered to be part of the input sequence.
int_type pbackfail(int_type c = traits::eof()) override;
// Effects: Puts back the character designated by c to the input sequence, if possible, in one of three ways:
// — If traits::eq_int_type(c, traits::eof()) returns false and if the input sequence has a putback position available, and if traits::eq(to_char_type(c), gptr()[-1]) returns true, assigns gptr() - 1 to gptr().
// Returns: c.
// — If traits::eq_int_type(c, traits::eof()) returns false and if the input sequence has a
putback position available, and if mode & ios_base::out is nonzero, assigns c to *--gptr().
// Returns: c.
// — If traits::eq_int_type(c, traits::eof()) returns true and if the input sequence has a
putback position available, assigns gptr() - 1 to gptr().
// Returns: traits::not_eof(c).
// Returns: As specified above, or traits::eof() to indicate failure.
// Remarks: If the function can succeed in more than one of these ways, it is unspecified which way is chosen.
int_type overflow(int_type c = traits::eof()) override;
// Effects: Appends the character designated by c to the output sequence, if possible, in one of two ways:
// — If traits::eq_int_type(c, traits::eof()) returns false and if either the output sequence has a write position available or the function makes a write position available (as described below), the function calls sputc(c). Signals success by returning c.
// — If traits::eq_int_type(c, traits::eof()) returns true, there is no character to append.
// Signals success by returning a value other than traits::eof().
// Returns: As specified above, or traits::eof() to indicate failure.
// Remarks: The function can alter the number of write positions available as a result of any call.
// The function can make a write position available only if ios_base::out is set in mode. To make a write position available, the function reallocates (or initially allocates) an array object with a sufficient number of elements to hold the current array object (if any), plus at least one additional write position. If ios_base::in is set in mode, the function alters the read end pointer egptr() to point just past the new write position.
pos_type seekpos(pos_type sp,
ios_base::openmode which
pos_type seekoff(off_type off, ios_base::seekdir way,
ios_base::openmode which
= ios_base::in | ios_base::out) override;
// Effects: Alters the stream position within one of the controlled sequences, if possible, as indicated in Table 122.
// Table 122: seekoff positioning [tab:stringbuf.seekoff.pos] Otherwise the positioning operation fails.
// For a sequence to be positioned, the function determines newoff as indicated in Table 123. If the sequence’s next pointer (either gptr() or pptr()) is a null pointer and newoff is nonzero, the positioning operation fails.
// Table 123: newoff values [tab:stringbuf.seekoff.newoff] If (newoff + off) < 0, or if newoff + off refers to an uninitialized character (31.8.2.4), the posi- tioning operation fails. Otherwise, the function assigns xbeg + newoff + off to the next pointer xnext.
//Returns: pos_type(newoff), constructed from the resultant offset newoff (of type off_type), that stores the resultant stream position, if possible. If the positioning operation fails, or if the constructed object cannot represent the resultant stream position, the return value is pos_type(off_type(-1)).
Condition newoff Value
way == ios_base::beg 0
way == ios_base::cur the next pointer minus the begin- ning pointer (xnext - xbeg).
way == ios_base::end the high mark pointer minus the beginning pointer (high_mark -
xbeg).
= ios_base::in | ios_base::out) override;
// Effects: Equivalent to seekoff(off_type(sp), ios_base::beg, which).
// Returns: sp to indicate success, or pos_type(off_type(-1)) to indicate failure.
basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);
// Effects: implementation-defined, except that setbuf(0, 0) has no effect. Returns: this.
// 31.8.3 Class template basic_istringstream [istringstream]
// 31.8.3.1 General [istringstream.general]
namespace std {
template<class charT, class traits = char_traits<charT>,
class Allocator = allocator<charT>>
class basic_istringstream : public basic_istream<charT, traits> {
public:
using char_type = charT;
// — sb, the stringbuf object.
using int_type = typename traits::int_type;
using pos_type = typename traits::pos_type;
using off_type = typename traits::off_type;
using traits_type = traits;
using allocator_type = Allocator;
// 31.8.3.2, constructors
basic_istringstream() : basic_istringstream(ios_base::in) {} explicit basic_istringstream(ios_base::openmode which);
explicit basic_istringstream(
const basic_string<charT, traits, Allocator>& s,
ios_base::openmode which = ios_base::in);
basic_istringstream(ios_base::openmode which, const Allocator& a);
explicit basic_istringstream(
basic_string<charT, traits, Allocator>&& s,
ios_base::openmode which = ios_base::in);
template<class SAlloc>
basic_istringstream(
const basic_string<charT, traits, SAlloc>& s, const Allocator& a)
: basic_istringstream(s, ios_base::in, a) {}
template<class SAlloc>
basic_istringstream(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which, const Allocator& a);
template<class SAlloc>
explicit basic_istringstream(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which = ios_base::in);
basic_istringstream(const basic_istringstream&) = delete;
basic_istringstream(basic_istringstream&& rhs);
basic_istringstream& operator=(const basic_istringstream&) = delete;
basic_istringstream& operator=(basic_istringstream&& rhs);
// 31.8.3.3, swap
void swap(basic_istringstream& rhs);
// 31.8.3.4, members
basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
basic_string<charT, traits, Allocator> str() const &;
template<class SAlloc>
basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
basic_string<charT, traits, Allocator> str() &&;
basic_string_view<charT, traits> view() const noexcept;
void str(const basic_string<charT, traits, Allocator>& s);
template<class SAlloc>
void str(const basic_string<charT, traits, SAlloc>& s);
void str(basic_string<charT, traits, Allocator>&& s);
private:
basic_stringbuf<charT, traits, Allocator> sb; // exposition only
};
}
// The class basic_istringstream<charT, traits, Allocator> supports reading objects of class basic_- string<charT, traits, Allocator>. It uses a basic_stringbuf<charT, traits, Allocator> object to control the associated storage. For the sake of exposition, the maintained data is presented here as:
// 31.8.3.2 Constructors [istringstream.cons]
explicit basic_istringstream(ios_base::openmode which);
// Effects: Initializes the base class with basic_istream<charT, traits>(addressof(sb)) (31.7.4.2) and sb with basic_stringbuf<charT, traits, Allocator>(which | ios_base::in) (31.8.2.2).
explicit basic_istringstream(
const basic_string<charT, traits, Allocator>& s,
ios_base::openmode which = ios_base::in);
// Effects: Initializes the base class with basic_istream<charT, traits>(addressof(sb)) (31.7.4.2) and sb with basic_stringbuf<charT, traits, Allocator>(s, which | ios_base::in) (31.8.2.2).
basic_istringstream(ios_base::openmode which, const Allocator& a);
// Effects: Initializes the base class with basic_istream<charT, traits>(addressof(sb)) (31.7.4.2) and sb with basic_stringbuf<charT, traits, Allocator>(which | ios_base::in, a) (31.8.2.2).
explicit basic_istringstream(
basic_string<charT, traits, Allocator>&& s,
ios_base::openmode which = ios_base::in);
// Effects: Initializes the base class with basic_istream<charT, traits>(addressof(sb)) (31.7.4.2) and sb with basic_stringbuf<charT, traits, Allocator>(std::move(s), which | ios_base:: in) (31.8.2.2).
template<class SAlloc>
basic_istringstream(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which, const Allocator& a);
// Effects: Initializes the base class with basic_istream<charT, traits>(addressof(sb)) (31.7.4.2) and sb with basic_stringbuf<charT, traits, Allocator>(s, which | ios_base::in, a)
(31.8.2.2).
template<class SAlloc>
explicit basic_istringstream(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which = ios_base::in);
// Effects: Initializes the base class with basic_istream<charT, traits>(addressof(sb)) (31.7.4.2) and sb with basic_stringbuf<charT, traits, Allocator>(s, which | ios_base::in) (31.8.2.2).
basic_istringstream(basic_istringstream&& rhs);
// Effects: Move constructs from the rvalue rhs. This is accomplished by move constructing the base class, and the contained basic_stringbuf. Then calls basic_istream<charT, traits>::set_- rdbuf(addressof(sb)) to install the contained basic_stringbuf.
// 31.8.3.3 Swap [istringstream.swap]
void swap(basic_istringstream& rhs);
// Effects: Equivalent to:
basic_istream<charT, traits>::swap(rhs);
sb.swap(rhs.sb);
template<class charT, class traits, class Allocator>
void swap(basic_istringstream<charT, traits, Allocator>& x,
basic_istringstream<charT, traits, Allocator>& y);
// Effects: Equivalent to: x.swap(y).
// 31.8.3.4 Member functions [istringstream.members]
basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
// Returns:
const_cast<basic_stringbuf<charT, traits, Allocator>*>(addressof(sb)).
basic_string<charT, traits, Allocator> str() const &;
// Effects: Equivalent to:
return rdbuf()->str();
template<class SAlloc>
basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
// Effects: Equivalent to:
return rdbuf()->str(sa);
basic_string<charT,traits,Allocator> str() &&;
// Effects: Equivalent to:
return std::move(*rdbuf()).str();
basic_string_view<charT, traits> view() const noexcept;
// Effects: Equivalent to:
return rdbuf()->view();
void str(const basic_string<charT, traits, Allocator>& s);
// Effects: Equivalent to:
rdbuf()->str(s);
template<class SAlloc>
void str(const basic_string<charT, traits, SAlloc>& s);
// Effects: Equivalent to:
rdbuf()->str(s);
void str(basic_string<charT, traits, Allocator>&& s);
// Effects: Equivalent to:
rdbuf()->str(std::move(s));
// 31.8.4 Class template basic_ostringstream [ostringstream]
// 31.8.4.1 General [ostringstream.general]
namespace std {
template<class charT, class traits = char_traits<charT>,
class Allocator = allocator<charT>>
class basic_ostringstream : public basic_ostream<charT, traits> {
public:
using char_type = charT;
using int_type = typename traits::int_type;
using pos_type = typename traits::pos_type;
using off_type = typename traits::off_type;
using traits_type = traits;
using allocator_type = Allocator;
// 31.8.4.2, constructors
basic_ostringstream() : basic_ostringstream(ios_base::out) {} explicit basic_ostringstream(ios_base::openmode which);
explicit basic_ostringstream(
const basic_string<charT, traits, Allocator>& s,
ios_base::openmode which = ios_base::out);
basic_ostringstream(ios_base::openmode which, const Allocator& a);
explicit basic_ostringstream(
basic_string<charT, traits, Allocator>&& s,
ios_base::openmode which = ios_base::out);
template<class SAlloc>
basic_ostringstream(
const basic_string<charT, traits, SAlloc>& s, const Allocator& a)
: basic_ostringstream(s, ios_base::out, a) {}
template<class SAlloc>
basic_ostringstream(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which, const Allocator& a);
template<class SAlloc>
explicit basic_ostringstream(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which = ios_base::out);
basic_ostringstream(const basic_ostringstream&) = delete;
basic_ostringstream(basic_ostringstream&& rhs);
// — sb, the stringbuf object.
// 31.8.4.2 Constructors [ostringstream.cons]
explicit basic_ostringstream(ios_base::openmode which);
basic_ostringstream& operator=(const basic_ostringstream&) = delete;
basic_ostringstream& operator=(basic_ostringstream&& rhs);
// 31.8.4.3, swap
void swap(basic_ostringstream& rhs);
// 31.8.4.4, members
basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
basic_string<charT, traits, Allocator> str() const &;
template<class SAlloc>
basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
basic_string<charT, traits, Allocator> str() &&;
basic_string_view<charT, traits> view() const noexcept;
void str(const basic_string<charT, traits, Allocator>& s);
template<class SAlloc>
void str(const basic_string<charT, traits, SAlloc>& s);
void str(basic_string<charT, traits, Allocator>&& s);
private:
basic_stringbuf<charT, traits, Allocator> sb; // exposition only
};
}
// The class basic_ostringstream<charT, traits, Allocator> supports writing objects of class basic_- string<charT, traits, Allocator>. It uses a basic_stringbuf object to control the associated storage. For the sake of exposition, the maintained data is presented here as:
// Effects: Initializes the base class with basic_ostream<charT, traits>(addressof(sb)) (31.7.5.2) and sb with basic_stringbuf<charT, traits, Allocator>(which | ios_base::out) (31.8.2.2).
explicit basic_ostringstream(
const basic_string<charT, traits, Allocator>& s,
ios_base::openmode which = ios_base::out);
// Effects: Initializes the base class with basic_ostream<charT, traits>(addressof(sb)) (31.7.5.2) and sb with basic_stringbuf<charT, traits, Allocator>(s, which | ios_base::out) (31.8.2.2).
basic_ostringstream(ios_base::openmode which, const Allocator& a);
// Effects: Initializes the base class with basic_ostream<charT, traits>(addressof(sb)) (31.7.5.2) and sb with basic_stringbuf<charT, traits, Allocator>(which | ios_base::out, a) (31.8.2.2).
explicit basic_ostringstream(
basic_string<charT, traits, Allocator>&& s,
ios_base::openmode which = ios_base::out);
// Effects: Initializes the base class with basic_ostream<charT, traits>(addressof(sb)) (31.7.5.2) and sb with basic_stringbuf<charT, traits, Allocator>(std::move(s), which | ios_base:: out) (31.8.2.2).
template<class SAlloc>
basic_ostringstream(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which, const Allocator& a);
// Effects: Initializes the base class with basic_ostream<charT, traits>(addressof(sb)) (31.7.5.2) and sb with basic_stringbuf<charT, traits, Allocator>(s, which | ios_base::out, a) (31.8.2.2).
template<class SAlloc>
explicit basic_ostringstream(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which = ios_base::out);
// Constraints: is_same_v<SAlloc,Allocator> is false.
// Effects: Initializes the base class with basic_ostream<charT, traits>(addressof(sb)) (31.7.5.2) and sb with basic_stringbuf<charT, traits, Allocator>(s, which | ios_base::out)
(31.8.2.2). basic_ostringstream(basic_ostringstream&& rhs);
// Effects: Move constructs from the rvalue rhs. This is accomplished by move constructing the base class, and the contained basic_stringbuf. Then calls basic_ostream<charT, traits>::set_- rdbuf(addressof(sb)) to install the contained basic_stringbuf.
// 31.8.4.3 Swap [ostringstream.swap]
void swap(basic_ostringstream& rhs);
// Effects: Equivalent to:
basic_ostream<charT, traits>::swap(rhs);
sb.swap(rhs.sb);
template<class charT, class traits, class Allocator>
void swap(basic_ostringstream<charT, traits, Allocator>& x,
basic_ostringstream<charT, traits, Allocator>& y);
// Effects: Equivalent to: x.swap(y).
// 31.8.4.4 Member functions [ostringstream.members]
basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
// Returns:
const_cast<basic_stringbuf<charT, traits, Allocator>*>(addressof(sb)). basic_string<charT, traits, Allocator> str() const &;
// Effects: Equivalent to:
return rdbuf()->str();
template<class SAlloc>
basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
// Effects: Equivalent to:
return rdbuf()->str(sa);
basic_string<charT,traits,Allocator> str() &&;
// Effects: Equivalent to:
return std::move(*rdbuf()).str();
basic_string_view<charT, traits> view() const noexcept;
// Effects: Equivalent to:
return rdbuf()->view();
void str(const basic_string<charT, traits, Allocator>& s);
// Effects: Equivalent to:
rdbuf()->str(s);
template<class SAlloc>
void str(const basic_string<charT, traits, SAlloc>& s);
// Effects: Equivalent to:
rdbuf()->str(s);
void str(basic_string<charT, traits, Allocator>&& s);
// Effects: Equivalent to:
rdbuf()->str(std::move(s));
// 31.8.5 Class template basic_stringstream [stringstream]
// 31.8.5.1 General [stringstream.general]
namespace std {
template<class charT, class traits = char_traits<charT>,
class Allocator = allocator<charT>>
class basic_stringstream : public basic_iostream<charT, traits> {
public:
using char_type = charT;
using int_type = typename traits::int_type;
using pos_type = typename traits::pos_type;
using off_type = typename traits::off_type;
using traits_type = traits;
using allocator_type = Allocator;
// 31.8.5.2, constructors
basic_stringstream() : basic_stringstream(ios_base::out | ios_base::in) {} explicit basic_stringstream(ios_base::openmode which);
explicit basic_stringstream(
const basic_string<charT, traits, Allocator>& s,
ios_base::openmode which = ios_base::out | ios_base::in);
basic_stringstream(ios_base::openmode which, const Allocator& a);
explicit basic_stringstream(
basic_string<charT, traits, Allocator>&& s,
ios_base::openmode which = ios_base::out | ios_base::in);
template<class SAlloc>
basic_stringstream(
const basic_string<charT, traits, SAlloc>& s, const Allocator& a)
: basic_stringstream(s, ios_base::out | ios_base::in, a) {}
template<class SAlloc>
basic_stringstream(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which, const Allocator& a);
template<class SAlloc>
explicit basic_stringstream(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which = ios_base::out | ios_base::in);
basic_stringstream(const basic_stringstream&) = delete;
basic_stringstream(basic_stringstream&& rhs);
basic_stringstream& operator=(const basic_stringstream&) = delete;
basic_stringstream& operator=(basic_stringstream&& rhs);
// 31.8.5.3, swap
void swap(basic_stringstream& rhs);
// 31.8.5.4, members
basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
basic_string<charT, traits, Allocator> str() const &;
template<class SAlloc>
basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
basic_string<charT, traits, Allocator> str() &&;
basic_string_view<charT, traits> view() const noexcept;
void str(const basic_string<charT, traits, Allocator>& s);
template<class SAlloc>
void str(const basic_string<charT, traits, SAlloc>& s);
void str(basic_string<charT, traits, Allocator>&& s);
private:
basic_stringbuf<charT, traits> sb; // exposition only
};
}
// The class template basic_stringstream<charT, traits> supports reading and writing from objects of class basic_string<charT, traits, Allocator>. It uses a basic_stringbuf<charT, traits, Alloca- tor> object to control the associated sequence. For the sake of exposition, the maintained data is presented here as
// — sb, the stringbuf object.
// 31.8.5.2 Constructors [stringstream.cons]
explicit basic_stringstream(ios_base::openmode which);
// Effects: Initializes the base class with basic_iostream<charT, traits>(addressof(sb)) (31.7.4.7.2) and sb with basic_stringbuf<charT, traits, Allocator>(which).
explicit basic_stringstream(
const basic_string<charT, traits, Allocator>& s,
ios_base::openmode which = ios_base::out | ios_base::in);
// Effects: Initializes the base class with basic_iostream<charT, traits>(addressof(sb)) (31.7.4.7.2) and sb with basic_stringbuf<charT, traits, Allocator>(s, which).
basic_stringstream(ios_base::openmode which, const Allocator& a);
// Effects: Initializes the base class with basic_iostream<charT, traits>(addressof(sb)) (31.7.4.7.2) and sb with basic_stringbuf<charT, traits, Allocator>(which, a) (31.8.2.2).
explicit basic_stringstream(
basic_string<charT, traits, Allocator>&& s,
ios_base::openmode which = ios_base::out | ios_base::in);
// Effects: Initializes the base class with basic_iostream<charT, traits>(addressof(sb)) (31.7.4.7.2) and sb with basic_stringbuf<charT, traits, Allocator>(std::move(s), which) (31.8.2.2).
template<class SAlloc>
basic_stringstream(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which, const Allocator& a);
// Effects: Initializes the base class with basic_iostream<charT, traits>(addressof(sb)) (31.7.4.7.2) and sb with basic_stringbuf<charT, traits, Allocator>(s, which, a) (31.8.2.2).
template<class SAlloc>
explicit basic_stringstream(
const basic_string<charT, traits, SAlloc>& s,
ios_base::openmode which = ios_base::out | ios_base::in);
// Constraints: is_same_v<SAlloc,Allocator> is false.
// Effects: Initializes the base class with basic_iostream<charT, traits>(addressof(sb)) (31.7.4.7.2) and sb with basic_stringbuf<charT, traits, Allocator>(s, which) (31.8.2.2).
basic_stringstream(basic_stringstream&& rhs);
// Effects: Move constructs from the rvalue rhs. This is accomplished by move constructing the base class, and the contained basic_stringbuf. Then calls basic_istream<charT, traits>::set_- rdbuf(addressof(sb)) to install the contained basic_stringbuf.
// 31.8.5.3 Swap [stringstream.swap]
void swap(basic_stringstream& rhs);
// Effects: Equivalent to:
basic_iostream<charT,traits>::swap(rhs);
sb.swap(rhs.sb);
template<class charT, class traits, class Allocator>
void swap(basic_stringstream<charT, traits, Allocator>& x,
basic_stringstream<charT, traits, Allocator>& y);
// Effects: Equivalent to: x.swap(y).
// 31.8.5.4 Member functions [stringstream.members]
basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
// Returns: const_cast<basic_stringbuf<charT, traits, Allocator>*>(addressof(sb)).
basic_string<charT, traits, Allocator> str() const &;
// Effects: Equivalent to: return rdbuf()->str(); template<class SAlloc>
basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
// Effects: Equivalent to:
return rdbuf()->str(sa);
basic_string<charT,traits,Allocator> str() &&;
// Effects: Equivalent to:
return std::move(*rdbuf()).str();
basic_string_view<charT, traits> view() const noexcept;
// Effects: Equivalent to:
return rdbuf()->view();
void str(const basic_string<charT, traits, Allocator>& s);
// Effects: Equivalent to:
rdbuf()->str(s);
template<class SAlloc>
void str(const basic_string<charT, traits, SAlloc>& s);
// Effects: Equivalent to:
rdbuf()->str(s);
void str(basic_string<charT, traits, Allocator>&& s);
// Effects: Equivalent to:
rdbuf()->str(std::move(s));
int main() {
cout << n4910 << endl;
return EXIT_SUCCESS;
}
編纂・実行結果(compile and go)
$ clang++ p1539.cpp -std=03 -o p1539l -I. -Wall
In file included from p1539.cpp:10:
In file included from ./N4910.h:11:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/atomic:38:
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/c++0x_warning.h:32:2: error: This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
^
p1539.cpp:15:1: error: unknown type name 'String'; did you mean 'string'?
String-based streams Header <sstream> synopsis
^~~~~~
string
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stringfwd.h:79:33: note: 'string' declared here
typedef basic_string<char> string;
^
p1539.cpp:15:7: error: expected unqualified-id
String-based streams Header <sstream> synopsis
^
p1539.cpp:18:45: error: a space is required between consecutive right angle brackets (use '> >')
class Allocator = allocator<charT>>
^~
> >
p1539.cpp:21:15: error: reference to 'basic_stringbuf' is ambiguous
void swap(basic_stringbuf<charT, traits, Allocator>& x,
^
p1539.cpp:19:11: note: candidate found by name lookup is 'std::basic_stringbuf'
class basic_stringbuf;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:65:11: note: candidate found by name lookup is 'std::__cxx11::basic_stringbuf'
class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
^
p1539.cpp:22:15: error: reference to 'basic_stringbuf' is ambiguous
basic_stringbuf<charT, traits, Allocator>& y) noexcept(noexcept(x.swap(y)));
^
p1539.cpp:19:11: note: candidate found by name lookup is 'std::basic_stringbuf'
class basic_stringbuf;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:65:11: note: candidate found by name lookup is 'std::__cxx11::basic_stringbuf'
class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
^
p1539.cpp:22:60: error: expected ';' at end of declaration
basic_stringbuf<charT, traits, Allocator>& y) noexcept(noexcept(x.swap(y)));
^
;
p1539.cpp:22:61: error: C++ requires a type specifier for all declarations
basic_stringbuf<charT, traits, Allocator>& y) noexcept(noexcept(x.swap(y)));
^
p1539.cpp:22:79: error: use of undeclared identifier 'x'
basic_stringbuf<charT, traits, Allocator>& y) noexcept(noexcept(x.swap(y)));
^
p1539.cpp:22:86: error: use of undeclared identifier 'y'
basic_stringbuf<charT, traits, Allocator>& y) noexcept(noexcept(x.swap(y)));
^
p1539.cpp:23:22: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using stringbuf = basic_stringbuf<char>;
^
p1539.cpp:23:22: error: reference to 'basic_stringbuf' is ambiguous
p1539.cpp:19:11: note: candidate found by name lookup is 'std::basic_stringbuf'
class basic_stringbuf;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:65:11: note: candidate found by name lookup is 'std::__cxx11::basic_stringbuf'
class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
^
p1539.cpp:23:9: error: typedef redefinition with different types ('basic_stringbuf<char>' (aka 'std::basic_stringbuf<char>') vs 'basic_stringbuf<char>' (aka 'std::__cxx11::basic_stringbuf<char>'))
using stringbuf = basic_stringbuf<char>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iosfwd:147:34: note: previous definition is here
typedef basic_stringbuf<char> stringbuf;
^
p1539.cpp:24:22: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using wstringbuf = basic_stringbuf<wchar_t>;
^
p1539.cpp:24:22: error: reference to 'basic_stringbuf' is ambiguous
p1539.cpp:19:11: note: candidate found by name lookup is 'std::basic_stringbuf'
class basic_stringbuf;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:65:11: note: candidate found by name lookup is 'std::__cxx11::basic_stringbuf'
class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
^
p1539.cpp:24:9: error: typedef redefinition with different types ('basic_stringbuf<wchar_t>' (aka 'std::basic_stringbuf<wchar_t>') vs 'basic_stringbuf<wchar_t>' (aka 'std::__cxx11::basic_stringbuf<wchar_t>'))
using wstringbuf = basic_stringbuf<wchar_t>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iosfwd:187:37: note: previous definition is here
typedef basic_stringbuf<wchar_t> wstringbuf;
^
p1539.cpp:26:45: error: a space is required between consecutive right angle brackets (use '> >')
class Allocator = allocator<charT>>
^~
> >
p1539.cpp:29:15: error: reference to 'basic_istringstream' is ambiguous
void swap(basic_istringstream<charT, traits, Allocator>& x,
^
p1539.cpp:27:11: note: candidate found by name lookup is 'std::basic_istringstream'
class basic_istringstream;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:392:11: note: candidate found by name lookup is 'std::__cxx11::basic_istringstream'
class basic_istringstream : public basic_istream<_CharT, _Traits>
^
p1539.cpp:30:15: error: reference to 'basic_istringstream' is ambiguous
basic_istringstream<charT, traits, Allocator>& y);
^
p1539.cpp:27:11: note: candidate found by name lookup is 'std::basic_istringstream'
class basic_istringstream;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:392:11: note: candidate found by name lookup is 'std::__cxx11::basic_istringstream'
class basic_istringstream : public basic_istream<_CharT, _Traits>
^
p1539.cpp:31:26: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using istringstream = basic_istringstream<char>;
^
p1539.cpp:31:26: error: reference to 'basic_istringstream' is ambiguous
p1539.cpp:27:11: note: candidate found by name lookup is 'std::basic_istringstream'
class basic_istringstream;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:392:11: note: candidate found by name lookup is 'std::__cxx11::basic_istringstream'
class basic_istringstream : public basic_istream<_CharT, _Traits>
^
p1539.cpp:31:9: error: typedef redefinition with different types ('basic_istringstream<char>' (aka 'std::basic_istringstream<char>') vs 'basic_istringstream<char>' (aka 'std::__cxx11::basic_istringstream<char>'))
using istringstream = basic_istringstream<char>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iosfwd:150:38: note: previous definition is here
typedef basic_istringstream<char> istringstream;
^
p1539.cpp:32:26: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using wistringstream = basic_istringstream<wchar_t>;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
4 warnings and 20 errors generated.
$ clang++ p1539.cpp -std=2b -o p1539l -I. -Wall
p1539.cpp:15:1: error: unknown type name 'String'; did you mean 'string'?
String-based streams Header <sstream> synopsis
^~~~~~
string
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stringfwd.h:79:33: note: 'string' declared here
typedef basic_string<char> string;
^
p1539.cpp:15:7: error: expected unqualified-id
String-based streams Header <sstream> synopsis
^
p1539.cpp:21:15: error: reference to 'basic_stringbuf' is ambiguous
void swap(basic_stringbuf<charT, traits, Allocator>& x,
^
p1539.cpp:19:11: note: candidate found by name lookup is 'std::basic_stringbuf'
class basic_stringbuf;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:65:11: note: candidate found by name lookup is 'std::__cxx11::basic_stringbuf'
class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
^
p1539.cpp:22:15: error: reference to 'basic_stringbuf' is ambiguous
basic_stringbuf<charT, traits, Allocator>& y) noexcept(noexcept(x.swap(y)));
^
p1539.cpp:19:11: note: candidate found by name lookup is 'std::basic_stringbuf'
class basic_stringbuf;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:65:11: note: candidate found by name lookup is 'std::__cxx11::basic_stringbuf'
class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
^
p1539.cpp:23:22: error: reference to 'basic_stringbuf' is ambiguous
using stringbuf = basic_stringbuf<char>;
^
p1539.cpp:19:11: note: candidate found by name lookup is 'std::basic_stringbuf'
class basic_stringbuf;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:65:11: note: candidate found by name lookup is 'std::__cxx11::basic_stringbuf'
class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
^
p1539.cpp:23:9: error: typedef redefinition with different types ('basic_stringbuf<char>' (aka 'std::basic_stringbuf<char>') vs 'basic_stringbuf<char>' (aka 'std::__cxx11::basic_stringbuf<char>'))
using stringbuf = basic_stringbuf<char>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iosfwd:147:34: note: previous definition is here
typedef basic_stringbuf<char> stringbuf;
^
p1539.cpp:24:22: error: reference to 'basic_stringbuf' is ambiguous
using wstringbuf = basic_stringbuf<wchar_t>;
^
p1539.cpp:19:11: note: candidate found by name lookup is 'std::basic_stringbuf'
class basic_stringbuf;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:65:11: note: candidate found by name lookup is 'std::__cxx11::basic_stringbuf'
class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
^
p1539.cpp:24:9: error: typedef redefinition with different types ('basic_stringbuf<wchar_t>' (aka 'std::basic_stringbuf<wchar_t>') vs 'basic_stringbuf<wchar_t>' (aka 'std::__cxx11::basic_stringbuf<wchar_t>'))
using wstringbuf = basic_stringbuf<wchar_t>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iosfwd:187:37: note: previous definition is here
typedef basic_stringbuf<wchar_t> wstringbuf;
^
p1539.cpp:29:15: error: reference to 'basic_istringstream' is ambiguous
void swap(basic_istringstream<charT, traits, Allocator>& x,
^
p1539.cpp:27:11: note: candidate found by name lookup is 'std::basic_istringstream'
class basic_istringstream;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:392:11: note: candidate found by name lookup is 'std::__cxx11::basic_istringstream'
class basic_istringstream : public basic_istream<_CharT, _Traits>
^
p1539.cpp:30:15: error: reference to 'basic_istringstream' is ambiguous
basic_istringstream<charT, traits, Allocator>& y);
^
p1539.cpp:27:11: note: candidate found by name lookup is 'std::basic_istringstream'
class basic_istringstream;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:392:11: note: candidate found by name lookup is 'std::__cxx11::basic_istringstream'
class basic_istringstream : public basic_istream<_CharT, _Traits>
^
p1539.cpp:31:26: error: reference to 'basic_istringstream' is ambiguous
using istringstream = basic_istringstream<char>;
^
p1539.cpp:27:11: note: candidate found by name lookup is 'std::basic_istringstream'
class basic_istringstream;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:392:11: note: candidate found by name lookup is 'std::__cxx11::basic_istringstream'
class basic_istringstream : public basic_istream<_CharT, _Traits>
^
p1539.cpp:31:9: error: typedef redefinition with different types ('basic_istringstream<char>' (aka 'std::basic_istringstream<char>') vs 'basic_istringstream<char>' (aka 'std::__cxx11::basic_istringstream<char>'))
using istringstream = basic_istringstream<char>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iosfwd:150:38: note: previous definition is here
typedef basic_istringstream<char> istringstream;
^
p1539.cpp:32:26: error: reference to 'basic_istringstream' is ambiguous
using wistringstream = basic_istringstream<wchar_t>;
^
p1539.cpp:27:11: note: candidate found by name lookup is 'std::basic_istringstream'
class basic_istringstream;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:392:11: note: candidate found by name lookup is 'std::__cxx11::basic_istringstream'
class basic_istringstream : public basic_istream<_CharT, _Traits>
^
p1539.cpp:32:9: error: typedef redefinition with different types ('basic_istringstream<wchar_t>' (aka 'std::basic_istringstream<wchar_t>') vs 'basic_istringstream<wchar_t>' (aka 'std::__cxx11::basic_istringstream<wchar_t>'))
using wistringstream = basic_istringstream<wchar_t>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iosfwd:190:41: note: previous definition is here
typedef basic_istringstream<wchar_t> wistringstream;
^
p1539.cpp:37:15: error: reference to 'basic_ostringstream' is ambiguous
void swap(basic_ostringstream<charT, traits, Allocator>& x,
^
p1539.cpp:35:11: note: candidate found by name lookup is 'std::basic_ostringstream'
class basic_ostringstream;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:550:11: note: candidate found by name lookup is 'std::__cxx11::basic_ostringstream'
class basic_ostringstream : public basic_ostream<_CharT, _Traits>
^
p1539.cpp:38:15: error: reference to 'basic_ostringstream' is ambiguous
basic_ostringstream<charT, traits, Allocator>& y);
^
p1539.cpp:35:11: note: candidate found by name lookup is 'std::basic_ostringstream'
class basic_ostringstream;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:550:11: note: candidate found by name lookup is 'std::__cxx11::basic_ostringstream'
class basic_ostringstream : public basic_ostream<_CharT, _Traits>
^
p1539.cpp:39:26: error: reference to 'basic_ostringstream' is ambiguous
using ostringstream = basic_ostringstream<char>;
^
p1539.cpp:35:11: note: candidate found by name lookup is 'std::basic_ostringstream'
class basic_ostringstream;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:550:11: note: candidate found by name lookup is 'std::__cxx11::basic_ostringstream'
class basic_ostringstream : public basic_ostream<_CharT, _Traits>
^
p1539.cpp:39:9: error: typedef redefinition with different types ('basic_ostringstream<char>' (aka 'std::basic_ostringstream<char>') vs 'basic_ostringstream<char>' (aka 'std::__cxx11::basic_ostringstream<char>'))
using ostringstream = basic_ostringstream<char>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iosfwd:153:38: note: previous definition is here
typedef basic_ostringstream<char> ostringstream;
^
p1539.cpp:40:26: error: reference to 'basic_ostringstream' is ambiguous
using wostringstream = basic_ostringstream<wchar_t>;
^
p1539.cpp:35:11: note: candidate found by name lookup is 'std::basic_ostringstream'
class basic_ostringstream;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/sstream:550:11: note: candidate found by name lookup is 'std::__cxx11::basic_ostringstream'
class basic_ostringstream : public basic_ostream<_CharT, _Traits>
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
$ g++ p1539.cpp -std=03 -o p1539g -I. -Wall
In file included from /usr/local/include/c++/12.1.0/atomic:38,
from N4910.h:11,
from p1539.cpp:10:
/usr/local/include/c++/12.1.0/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
32 | #error This file requires compiler and library support \
| ^~~~~
p1539.cpp:22:61: warning: identifier 'noexcept' is a keyword in C++11 [-Wc++11-compat]
22 | basic_stringbuf<charT, traits, Allocator>& y) noexcept(noexcept(x.swap(y)));
| ^~~~~~~~
p1539.cpp:334:2: error: too many decimal points in number
334 | (31.8.2.2).
| ^~~~~~~~
p1539.cpp:453:2: error: too many decimal points in number
453 | (31.8.2.2). basic_ostringstream(basic_ostringstream&& rhs);
| ^~~~~~~~
p1539.cpp:15:1: error: 'String' does not name a type
15 | String-based streams Header <sstream> synopsis
| ^~~~~~
p1539.cpp:55:47: error: spurious '>>', use '>' to terminate a template argument list
55 | class Allocator = allocator<charT>>
| ^~
p1539.cpp:56:67: error: definition of 'class std::basic_stringbuf' inside template parameter list
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^
p1539.cpp:55:32: error: two or more data types in declaration of 'type name'
55 | class Allocator = allocator<charT>>
| ^~~~~~~~~~~~~~~~~
p1539.cpp:122:2: error: expected '>' before ';' token
122 | }; }
| ^
p1539.cpp:122:2: error: expected unqualified-id before ';' token
p1539.cpp:127:10: error: ISO C++ forbids declaration of 'basic_stringbuf' with no type [-fpermissive]
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:127:1: error: 'explicit' outside class declaration
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~
p1539.cpp:131:22: error: 'charT' was not declared in this scope; did you mean 'char'?
131 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~
| char
p1539.cpp:131:29: error: 'traits' was not declared in this scope
131 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~
p1539.cpp:131:37: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
131 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~~~~
| alloca
p1539.cpp:131:46: error: template argument 1 is invalid
131 | const basic_string<charT, traits, Allocator>& s,
| ^
p1539.cpp:131:46: error: template argument 2 is invalid
p1539.cpp:131:46: error: template argument 3 is invalid
p1539.cpp:130:10: error: ISO C++ forbids declaration of 'basic_stringbuf' with no type [-fpermissive]
130 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:130:1: error: 'explicit' outside class declaration
130 | explicit basic_stringbuf(
| ^~~~~~~~
p1539.cpp:134:49: error: 'Allocator' does not name a type; did you mean 'alloca'?
134 | basic_stringbuf(ios_base::openmode which, const Allocator &a);
| ^~~~~~~~~
| alloca
p1539.cpp:134:62: error: expected constructor, destructor, or type conversion before ';' token
134 | basic_stringbuf(ios_base::openmode which, const Allocator &a);
| ^
p1539.cpp:138:16: error: 'charT' was not declared in this scope; did you mean 'char'?
138 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~
| char
p1539.cpp:138:23: error: 'traits' was not declared in this scope
138 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~
p1539.cpp:138:31: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
138 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~~~~
| alloca
p1539.cpp:138:40: error: template argument 1 is invalid
138 | basic_string<charT, traits, Allocator>&& s,
| ^
p1539.cpp:138:40: error: template argument 2 is invalid
p1539.cpp:138:40: error: template argument 3 is invalid
p1539.cpp:138:41: error: expected ',' or '...' before '&&' token
138 | basic_string<charT, traits, Allocator>&& s,
| ^~
p1539.cpp:137:10: error: ISO C++ forbids declaration of 'basic_stringbuf' with no type [-fpermissive]
137 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:137:1: error: 'explicit' outside class declaration
137 | explicit basic_stringbuf(
| ^~~~~~~~
p1539.cpp:143:24: error: 'charT' was not declared in this scope; did you mean 'char'?
143 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~
| char
p1539.cpp:143:31: error: 'traits' was not declared in this scope
143 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~~
p1539.cpp:143:45: error: template argument 1 is invalid
143 | const basic_string<charT, traits, SAlloc>& s,
| ^
p1539.cpp:143:45: error: template argument 2 is invalid
p1539.cpp:144:33: error: 'Allocator' does not name a type; did you mean 'alloca'?
144 | ios_base::openmode which, const Allocator &a);
| ^~~~~~~~~
| alloca
p1539.cpp:144:46: error: expected constructor, destructor, or type conversion before ';' token
144 | ios_base::openmode which, const Allocator &a);
| ^
p1539.cpp:148:20: error: 'charT' was not declared in this scope; did you mean 'char'?
148 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~
| char
p1539.cpp:148:27: error: 'traits' was not declared in this scope
148 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~~
p1539.cpp:148:41: error: template argument 1 is invalid
148 | const basic_string<charT, traits, SAlloc>& s,
| ^
p1539.cpp:148:41: error: template argument 2 is invalid
p1539.cpp:147:12: error: ISO C++ forbids declaration of 'basic_stringbuf' with no type [-fpermissive]
147 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:147:3: error: 'explicit' outside class declaration
147 | explicit basic_stringbuf(
| ^~~~~~~~
p1539.cpp:152:16: error: expected constructor, destructor, or type conversion before '(' token
152 | basic_stringbuf(basic_stringbuf&& rhs, const Allocator& a);
| ^
p1539.cpp:169:1: error: reference to 'basic_stringbuf' is ambiguous
169 | basic_stringbuf& operator=(basic_stringbuf&& rhs);
| ^~~~~~~~~~~~~~~
In file included from /usr/local/include/c++/12.1.0/ios:38,
from /usr/local/include/c++/12.1.0/ostream:38,
from /usr/local/include/c++/12.1.0/iostream:39,
from N4910.h:2:
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:147:12: note: 'template<class SAlloc> int basic_stringbuf(const int&, std::ios_base::openmode)'
147 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:137:10: note: 'int basic_stringbuf(int)'
137 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:130:10: note: 'int basic_stringbuf(const int&, std::ios_base::openmode)'
130 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:127:10: note: 'int basic_stringbuf(std::ios_base::openmode)'
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:171:1: error: 'Returns' does not name a type
171 | Returns: *this.
| ^~~~~~~
p1539.cpp:174:8: error: found ':' in nested-name-specifier, expected '::'
174 | Effects: Exchanges the state of *this and rhs.
| ^
| ::
p1539.cpp:174:1: error: 'Effects' does not name a type
174 | Effects: Exchanges the state of *this and rhs.
| ^~~~~~~
p1539.cpp:189:1: error: 'allocator_type' does not name a type
189 | allocator_type get_allocator() const noexcept;
| ^~~~~~~~~~~~~~
p1539.cpp:191:14: error: 'charT' was not declared in this scope; did you mean 'char'?
191 | basic_string<charT, traits, Allocator> str() const &;
| ^~~~~
| char
p1539.cpp:191:21: error: 'traits' was not declared in this scope
191 | basic_string<charT, traits, Allocator> str() const &;
| ^~~~~~
p1539.cpp:191:29: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
191 | basic_string<charT, traits, Allocator> str() const &;
| ^~~~~~~~~
| alloca
p1539.cpp:191:38: error: template argument 1 is invalid
191 | basic_string<charT, traits, Allocator> str() const &;
| ^
p1539.cpp:191:38: error: template argument 2 is invalid
p1539.cpp:191:38: error: template argument 3 is invalid
p1539.cpp:191:52: error: non-member function 'int str()' cannot have cv-qualifier
191 | basic_string<charT, traits, Allocator> str() const &;
| ^
p1539.cpp:191:52: error: non-member function 'int str()' cannot have ref-qualifier
p1539.cpp:193:1: error: expected unqualified-id before 'return'
193 | return basic_string<charT, traits, Allocator>(view(), get_allocator());
| ^~~~~~
p1539.cpp:195:16: error: 'charT' was not declared in this scope; did you mean 'char'?
195 | basic_string<charT, traits, SAlloc> str(const SAlloc& sa) const;
| ^~~~~
| char
p1539.cpp:195:23: error: 'traits' was not declared in this scope
195 | basic_string<charT, traits, SAlloc> str(const SAlloc& sa) const;
| ^~~~~~
p1539.cpp:195:37: error: template argument 1 is invalid
195 | basic_string<charT, traits, SAlloc> str(const SAlloc& sa) const;
| ^
p1539.cpp:195:37: error: template argument 2 is invalid
p1539.cpp:195:61: error: non-member function 'int str(const SAlloc&)' cannot have cv-qualifier
195 | basic_string<charT, traits, SAlloc> str(const SAlloc& sa) const;
| ^~~~~
p1539.cpp:197:8: error: expected unqualified-id before 'return'
197 | return basic_string<charT, traits, SAlloc>(view(), sa);
| ^~~~~~
p1539.cpp:198:14: error: 'charT' was not declared in this scope; did you mean 'char'?
198 | basic_string<charT, traits, Allocator> str() &&;
| ^~~~~
| char
p1539.cpp:198:21: error: 'traits' was not declared in this scope
198 | basic_string<charT, traits, Allocator> str() &&;
| ^~~~~~
p1539.cpp:198:29: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
198 | basic_string<charT, traits, Allocator> str() &&;
| ^~~~~~~~~
| alloca
p1539.cpp:198:38: error: template argument 1 is invalid
198 | basic_string<charT, traits, Allocator> str() &&;
| ^
p1539.cpp:198:38: error: template argument 2 is invalid
p1539.cpp:198:38: error: template argument 3 is invalid
p1539.cpp:198:46: error: non-member function 'int str()' cannot have ref-qualifier
198 | basic_string<charT, traits, Allocator> str() &&;
| ^~
p1539.cpp:201:1: error: 'basic_string_view' does not name a type
201 | basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~~~~~~~~~~~~
p1539.cpp:207:29: error: 'charT' was not declared in this scope; did you mean 'char'?
207 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~
| char
p1539.cpp:207:36: error: 'traits' was not declared in this scope
207 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~
p1539.cpp:207:44: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
207 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~~~~
| alloca
p1539.cpp:207:53: error: template argument 1 is invalid
207 | void str(const basic_string<charT, traits, Allocator>& s);
| ^
p1539.cpp:207:53: error: template argument 2 is invalid
p1539.cpp:207:53: error: template argument 3 is invalid
p1539.cpp:209:8: error: 'buf' does not name a type
209 | buf = s;
| ^~~
p1539.cpp:210:23: error: expected constructor, destructor, or type conversion before ';' token
210 | init_buf_ptrs();
| ^
p1539.cpp:212:31: error: 'charT' was not declared in this scope; did you mean 'char'?
212 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~
| char
p1539.cpp:212:38: error: 'traits' was not declared in this scope
212 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~~
p1539.cpp:212:52: error: template argument 1 is invalid
212 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^
p1539.cpp:212:52: error: template argument 2 is invalid
p1539.cpp:215:8: error: 'buf' does not name a type
215 | buf = s;
| ^~~
p1539.cpp:216:23: error: expected constructor, destructor, or type conversion before ';' token
216 | init_buf_ptrs();
| ^
p1539.cpp:217:23: error: 'charT' was not declared in this scope; did you mean 'char'?
217 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~
| char
p1539.cpp:217:30: error: 'traits' was not declared in this scope
217 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~
p1539.cpp:217:38: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
217 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~~~~
| alloca
p1539.cpp:217:47: error: template argument 1 is invalid
217 | void str(basic_string<charT, traits, Allocator>&& s);
| ^
p1539.cpp:217:47: error: template argument 2 is invalid
p1539.cpp:217:47: error: template argument 3 is invalid
p1539.cpp:217:48: error: expected ',' or '...' before '&&' token
217 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~
p1539.cpp:219:23: error: expected constructor, destructor, or type conversion before ';' token
219 | init_buf_ptrs();
| ^
p1539.cpp:221:1: error: 'int_type' does not name a type
221 | int_type underflow() override;
| ^~~~~~~~
p1539.cpp:223:1: error: 'int_type' does not name a type
223 | int_type pbackfail(int_type c = traits::eof()) override;
| ^~~~~~~~
p1539.cpp:228:1: error: 'putback' does not name a type
228 | putback position available, and if mode & ios_base::out is nonzero, assigns c to *--gptr().
| ^~~~~~~
p1539.cpp:243:1: error: 'pos_type' does not name a type
243 | pos_type seekpos(pos_type sp,
| ^~~~~~~~
p1539.cpp:253:2: error: 'Condition' does not name a type
253 | Condition newoff Value
| ^~~~~~~~~
p1539.cpp:261:17: error: 'charT' was not declared in this scope; did you mean 'char'?
261 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);
| ^~~~~
| char
p1539.cpp:261:24: error: 'traits' was not declared in this scope
261 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);
| ^~~~~~
p1539.cpp:261:30: error: template argument 1 is invalid
261 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);
| ^
p1539.cpp:261:30: error: template argument 2 is invalid
p1539.cpp:261:40: error: 'int* setbuf' redeclared as different kind of entity
261 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);
| ^~~~~
In file included from /usr/local/include/c++/12.1.0/cstdio:42,
from N4910.h:3:
/usr/include/stdio.h:304:13: note: previous declaration 'void setbuf(FILE*, char*)'
304 | extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __THROW;
| ^~~~~~
p1539.cpp:261:40: error: 'charT' was not declared in this scope; did you mean 'char'?
261 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);
| ^~~~~
| char
p1539.cpp:261:47: error: 's' was not declared in this scope
261 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);
| ^
p1539.cpp:261:61: error: expected primary-expression before 'n'
261 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);
| ^
p1539.cpp:267:47: error: spurious '>>', use '>' to terminate a template argument list
267 | class Allocator = allocator<charT>>
| ^~
p1539.cpp:268:69: error: definition of 'class std::basic_istringstream' inside template parameter list
268 | class basic_istringstream : public basic_istream<charT, traits> {
| ^
p1539.cpp:267:32: error: two or more data types in declaration of 'type name'
267 | class Allocator = allocator<charT>>
| ^~~~~~~~~~~~~~~~~
p1539.cpp:314:2: error: expected '>' before ';' token
314 | }; }
| ^
p1539.cpp:314:2: error: expected unqualified-id before ';' token
p1539.cpp:317:10: error: ISO C++ forbids declaration of 'basic_istringstream' with no type [-fpermissive]
317 | explicit basic_istringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:317:1: error: 'explicit' outside class declaration
317 | explicit basic_istringstream(ios_base::openmode which);
| ^~~~~~~~
p1539.cpp:320:22: error: 'charT' was not declared in this scope; did you mean 'char'?
320 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~
| char
p1539.cpp:320:29: error: 'traits' was not declared in this scope
320 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~
p1539.cpp:320:37: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
320 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~~~~
| alloca
p1539.cpp:320:46: error: template argument 1 is invalid
320 | const basic_string<charT, traits, Allocator>& s,
| ^
p1539.cpp:320:46: error: template argument 2 is invalid
p1539.cpp:320:46: error: template argument 3 is invalid
p1539.cpp:319:10: error: ISO C++ forbids declaration of 'basic_istringstream' with no type [-fpermissive]
319 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:319:1: error: 'explicit' outside class declaration
319 | explicit basic_istringstream(
| ^~~~~~~~
p1539.cpp:323:53: error: 'Allocator' does not name a type; did you mean 'alloca'?
323 | basic_istringstream(ios_base::openmode which, const Allocator& a);
| ^~~~~~~~~
| alloca
p1539.cpp:323:66: error: expected constructor, destructor, or type conversion before ';' token
323 | basic_istringstream(ios_base::openmode which, const Allocator& a);
| ^
p1539.cpp:326:16: error: 'charT' was not declared in this scope; did you mean 'char'?
326 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~
| char
p1539.cpp:326:23: error: 'traits' was not declared in this scope
326 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~
p1539.cpp:326:31: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
326 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~~~~
| alloca
p1539.cpp:326:40: error: template argument 1 is invalid
326 | basic_string<charT, traits, Allocator>&& s,
| ^
p1539.cpp:326:40: error: template argument 2 is invalid
p1539.cpp:326:40: error: template argument 3 is invalid
p1539.cpp:326:41: error: expected ',' or '...' before '&&' token
326 | basic_string<charT, traits, Allocator>&& s,
| ^~
p1539.cpp:325:10: error: ISO C++ forbids declaration of 'basic_istringstream' with no type [-fpermissive]
325 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:325:1: error: 'explicit' outside class declaration
325 | explicit basic_istringstream(
| ^~~~~~~~
p1539.cpp:331:20: error: 'charT' was not declared in this scope; did you mean 'char'?
331 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~
| char
p1539.cpp:331:27: error: 'traits' was not declared in this scope
331 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~~
p1539.cpp:331:41: error: template argument 1 is invalid
331 | const basic_string<charT, traits, SAlloc>& s,
| ^
p1539.cpp:331:41: error: template argument 2 is invalid
p1539.cpp:332:33: error: 'Allocator' does not name a type; did you mean 'alloca'?
332 | ios_base::openmode which, const Allocator& a);
| ^~~~~~~~~
| alloca
p1539.cpp:332:46: error: expected constructor, destructor, or type conversion before ';' token
332 | ios_base::openmode which, const Allocator& a);
| ^
p1539.cpp:334:2: error: expected unqualified-id before numeric constant
334 | (31.8.2.2).
| ^~~~~~~~
p1539.cpp:334:2: error: expected ')' before numeric constant
334 | (31.8.2.2).
| ~^~~~~~~~
| )
p1539.cpp:340:20: error: expected constructor, destructor, or type conversion before '(' token
340 | basic_istringstream(basic_istringstream&& rhs);
| ^
p1539.cpp:343:6: error: variable or field 'swap' declared void
343 | void swap(basic_istringstream& rhs);
| ^~~~
p1539.cpp:343:11: error: reference to 'basic_istringstream' is ambiguous
343 | void swap(basic_istringstream& rhs);
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:100:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_istringstream'
100 | class basic_istringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:325:10: note: 'int basic_istringstream(int)'
325 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:319:10: note: 'int basic_istringstream(const int&, std::ios_base::openmode)'
319 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:317:10: note: 'int basic_istringstream(std::ios_base::openmode)'
317 | explicit basic_istringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:343:32: error: 'rhs' was not declared in this scope
343 | void swap(basic_istringstream& rhs);
| ^~~
p1539.cpp:345:15: error: 'charT' was not declared in this scope; did you mean 'char'?
345 | basic_istream<charT, traits>::swap(rhs);
| ^~~~~
| char
p1539.cpp:345:22: error: 'traits' was not declared in this scope
345 | basic_istream<charT, traits>::swap(rhs);
| ^~~~~~
p1539.cpp:345:28: error: template argument 1 is invalid
345 | basic_istream<charT, traits>::swap(rhs);
| ^
p1539.cpp:345:28: error: template argument 2 is invalid
p1539.cpp:345:36: error: 'rhs' was not declared in this scope
345 | basic_istream<charT, traits>::swap(rhs);
| ^~~
p1539.cpp:346:3: error: 'sb' does not name a type
346 | sb.swap(rhs.sb);
| ^~
p1539.cpp:348:8: error: variable or field 'swap' declared void
348 | void swap(basic_istringstream<charT, traits, Allocator>& x,
| ^~~~
p1539.cpp:348:13: error: reference to 'basic_istringstream' is ambiguous
348 | void swap(basic_istringstream<charT, traits, Allocator>& x,
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:100:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_istringstream'
100 | class basic_istringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:325:10: note: 'int basic_istringstream(int)'
325 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:319:10: note: 'int basic_istringstream(const int&, std::ios_base::openmode)'
319 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:317:10: note: 'int basic_istringstream(std::ios_base::openmode)'
317 | explicit basic_istringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:348:38: error: expected primary-expression before ',' token
348 | void swap(basic_istringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:348:46: error: expected primary-expression before ',' token
348 | void swap(basic_istringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:348:57: error: expected primary-expression before '>' token
348 | void swap(basic_istringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:348:60: error: 'x' was not declared in this scope
348 | void swap(basic_istringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:349:13: error: reference to 'basic_istringstream' is ambiguous
349 | basic_istringstream<charT, traits, Allocator>& y);
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:100:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_istringstream'
100 | class basic_istringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:325:10: note: 'int basic_istringstream(int)'
325 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:319:10: note: 'int basic_istringstream(const int&, std::ios_base::openmode)'
319 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:317:10: note: 'int basic_istringstream(std::ios_base::openmode)'
317 | explicit basic_istringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:349:38: error: expected primary-expression before ',' token
349 | basic_istringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:349:46: error: expected primary-expression before ',' token
349 | basic_istringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:349:57: error: expected primary-expression before '>' token
349 | basic_istringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:349:60: error: 'y' was not declared in this scope; did you mean 'yn'?
349 | basic_istringstream<charT, traits, Allocator>& y);
| ^
| yn
p1539.cpp:352:1: error: reference to 'basic_stringbuf' is ambiguous
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:147:12: note: 'template<class SAlloc> int basic_stringbuf(const int&, std::ios_base::openmode)'
147 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:137:10: note: 'int basic_stringbuf(int)'
137 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:130:10: note: 'int basic_stringbuf(const int&, std::ios_base::openmode)'
130 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:127:10: note: 'int basic_stringbuf(std::ios_base::openmode)'
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:354:1: error: expected unqualified-id before 'const_cast'
354 | const_cast<basic_stringbuf<charT, traits, Allocator>*>(addressof(sb)).
| ^~~~~~~~~~
p1539.cpp:357:1: error: expected unqualified-id before 'return'
357 | return rdbuf()->str(); template<class SAlloc>
| ^~~~~~
p1539.cpp:358:16: error: 'charT' was not declared in this scope; did you mean 'char'?
358 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~
| char
p1539.cpp:358:22: error: 'traits' was not declared in this scope
358 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~~
p1539.cpp:358:35: error: template argument 1 is invalid
358 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^
p1539.cpp:358:35: error: template argument 2 is invalid
p1539.cpp:358:59: error: non-member function 'int str(const SAlloc&)' cannot have cv-qualifier
358 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~
p1539.cpp:360:1: error: expected unqualified-id before 'return'
360 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~
p1539.cpp:360:39: error: 'charT' was not declared in this scope; did you mean 'char'?
360 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~
| char
p1539.cpp:360:45: error: 'traits' was not declared in this scope
360 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~
p1539.cpp:360:52: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
360 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~~~~
| alloca
p1539.cpp:360:61: error: template argument 1 is invalid
360 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^
p1539.cpp:360:61: error: template argument 2 is invalid
p1539.cpp:360:61: error: template argument 3 is invalid
p1539.cpp:360:69: error: non-member function 'int str()' cannot have ref-qualifier
360 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~
p1539.cpp:362:1: error: expected unqualified-id before 'return'
362 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~
p1539.cpp:362:35: error: 'basic_string_view' does not name a type
362 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~~~~~~~~~~~~
p1539.cpp:364:1: error: expected unqualified-id before 'return'
364 | return rdbuf()->view();
| ^~~~~~
p1539.cpp:365:29: error: 'charT' was not declared in this scope; did you mean 'char'?
365 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~
| char
p1539.cpp:365:36: error: 'traits' was not declared in this scope
365 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~
p1539.cpp:365:44: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
365 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~~~~
| alloca
p1539.cpp:365:53: error: template argument 1 is invalid
365 | void str(const basic_string<charT, traits, Allocator>& s);
| ^
p1539.cpp:365:53: error: template argument 2 is invalid
p1539.cpp:365:53: error: template argument 3 is invalid
p1539.cpp:367:10: error: expected type-specifier before 'str'
367 | rdbuf()->str(s); template<class SAlloc>
| ^~~
p1539.cpp:367:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:368:31: error: 'charT' was not declared in this scope; did you mean 'char'?
368 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~
| char
p1539.cpp:368:38: error: 'traits' was not declared in this scope
368 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~~
p1539.cpp:368:52: error: template argument 1 is invalid
368 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^
p1539.cpp:368:52: error: template argument 2 is invalid
p1539.cpp:370:10: error: expected type-specifier before 'str'
370 | rdbuf()->str(s);
| ^~~
p1539.cpp:370:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:371:23: error: 'charT' was not declared in this scope; did you mean 'char'?
371 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~
| char
p1539.cpp:371:30: error: 'traits' was not declared in this scope
371 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~
p1539.cpp:371:38: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
371 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~~~~
| alloca
p1539.cpp:371:47: error: template argument 1 is invalid
371 | void str(basic_string<charT, traits, Allocator>&& s);
| ^
p1539.cpp:371:47: error: template argument 2 is invalid
p1539.cpp:371:47: error: template argument 3 is invalid
p1539.cpp:371:48: error: expected ',' or '...' before '&&' token
371 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~
p1539.cpp:373:10: error: expected type-specifier before 'str'
373 | rdbuf()->str(std::move(s));
| ^~~
p1539.cpp:373:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:378:47: error: spurious '>>', use '>' to terminate a template argument list
378 | class Allocator = allocator<charT>>
| ^~
p1539.cpp:379:69: error: definition of 'class std::basic_ostringstream' inside template parameter list
379 | class basic_ostringstream : public basic_ostream<charT, traits> {
| ^
p1539.cpp:378:32: error: two or more data types in declaration of 'type name'
378 | class Allocator = allocator<charT>>
| ^~~~~~~~~~~~~~~~~
p1539.cpp:429:2: error: expected '>' before ';' token
429 | }; }
| ^
p1539.cpp:429:2: error: expected unqualified-id before ';' token
p1539.cpp:433:22: error: 'charT' was not declared in this scope; did you mean 'char'?
433 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~
| char
p1539.cpp:433:29: error: 'traits' was not declared in this scope
433 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~
p1539.cpp:433:37: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
433 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~~~~
| alloca
p1539.cpp:433:46: error: template argument 1 is invalid
433 | const basic_string<charT, traits, Allocator>& s,
| ^
p1539.cpp:433:46: error: template argument 2 is invalid
p1539.cpp:433:46: error: template argument 3 is invalid
p1539.cpp:432:10: error: ISO C++ forbids declaration of 'basic_ostringstream' with no type [-fpermissive]
432 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:432:1: error: 'explicit' outside class declaration
432 | explicit basic_ostringstream(
| ^~~~~~~~
p1539.cpp:436:53: error: 'Allocator' does not name a type; did you mean 'alloca'?
436 | basic_ostringstream(ios_base::openmode which, const Allocator& a);
| ^~~~~~~~~
| alloca
p1539.cpp:436:66: error: expected constructor, destructor, or type conversion before ';' token
436 | basic_ostringstream(ios_base::openmode which, const Allocator& a);
| ^
p1539.cpp:439:16: error: 'charT' was not declared in this scope; did you mean 'char'?
439 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~
| char
p1539.cpp:439:23: error: 'traits' was not declared in this scope
439 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~
p1539.cpp:439:31: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
439 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~~~~
| alloca
p1539.cpp:439:40: error: template argument 1 is invalid
439 | basic_string<charT, traits, Allocator>&& s,
| ^
p1539.cpp:439:40: error: template argument 2 is invalid
p1539.cpp:439:40: error: template argument 3 is invalid
p1539.cpp:439:41: error: expected ',' or '...' before '&&' token
439 | basic_string<charT, traits, Allocator>&& s,
| ^~
p1539.cpp:438:10: error: ISO C++ forbids declaration of 'basic_ostringstream' with no type [-fpermissive]
438 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:438:1: error: 'explicit' outside class declaration
438 | explicit basic_ostringstream(
| ^~~~~~~~
p1539.cpp:444:20: error: 'charT' was not declared in this scope; did you mean 'char'?
444 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~
| char
p1539.cpp:444:27: error: 'traits' was not declared in this scope
444 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~~
p1539.cpp:444:41: error: template argument 1 is invalid
444 | const basic_string<charT, traits, SAlloc>& s,
| ^
p1539.cpp:444:41: error: template argument 2 is invalid
p1539.cpp:445:33: error: 'Allocator' does not name a type; did you mean 'alloca'?
445 | ios_base::openmode which, const Allocator& a);
| ^~~~~~~~~
| alloca
p1539.cpp:445:46: error: expected constructor, destructor, or type conversion before ';' token
445 | ios_base::openmode which, const Allocator& a);
| ^
p1539.cpp:449:24: error: 'charT' was not declared in this scope; did you mean 'char'?
449 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~
| char
p1539.cpp:449:31: error: 'traits' was not declared in this scope
449 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~~
p1539.cpp:449:45: error: template argument 1 is invalid
449 | const basic_string<charT, traits, SAlloc>& s,
| ^
p1539.cpp:449:45: error: template argument 2 is invalid
p1539.cpp:448:12: error: ISO C++ forbids declaration of 'basic_ostringstream' with no type [-fpermissive]
448 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:448:3: error: 'explicit' outside class declaration
448 | explicit basic_ostringstream(
| ^~~~~~~~
p1539.cpp:453:2: error: expected unqualified-id before numeric constant
453 | (31.8.2.2). basic_ostringstream(basic_ostringstream&& rhs);
| ^~~~~~~~
p1539.cpp:453:2: error: expected ')' before numeric constant
453 | (31.8.2.2). basic_ostringstream(basic_ostringstream&& rhs);
| ~^~~~~~~~
| )
p1539.cpp:456:6: error: variable or field 'swap' declared void
456 | void swap(basic_ostringstream& rhs);
| ^~~~
p1539.cpp:456:11: error: reference to 'basic_ostringstream' is ambiguous
456 | void swap(basic_ostringstream& rhs);
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:104:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_ostringstream'
104 | class basic_ostringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:448:12: note: 'template<class SAlloc> int basic_ostringstream(const int&, std::ios_base::openmode)'
448 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:438:10: note: 'int basic_ostringstream(int)'
438 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:432:10: note: 'int basic_ostringstream(const int&, std::ios_base::openmode)'
432 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:456:32: error: 'rhs' was not declared in this scope
456 | void swap(basic_ostringstream& rhs);
| ^~~
p1539.cpp:458:15: error: 'charT' was not declared in this scope; did you mean 'char'?
458 | basic_ostream<charT, traits>::swap(rhs);
| ^~~~~
| char
p1539.cpp:458:22: error: 'traits' was not declared in this scope
458 | basic_ostream<charT, traits>::swap(rhs);
| ^~~~~~
p1539.cpp:458:28: error: template argument 1 is invalid
458 | basic_ostream<charT, traits>::swap(rhs);
| ^
p1539.cpp:458:28: error: template argument 2 is invalid
p1539.cpp:458:31: error: redefinition of 'int swap'
458 | basic_ostream<charT, traits>::swap(rhs);
| ^~~~
p1539.cpp:345:31: note: 'int swap' previously defined here
345 | basic_istream<charT, traits>::swap(rhs);
| ^~~~
p1539.cpp:458:36: error: 'rhs' was not declared in this scope
458 | basic_ostream<charT, traits>::swap(rhs);
| ^~~
p1539.cpp:459:3: error: 'sb' does not name a type
459 | sb.swap(rhs.sb);
| ^~
p1539.cpp:461:8: error: variable or field 'swap' declared void
461 | void swap(basic_ostringstream<charT, traits, Allocator>& x,
| ^~~~
p1539.cpp:461:13: error: reference to 'basic_ostringstream' is ambiguous
461 | void swap(basic_ostringstream<charT, traits, Allocator>& x,
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:104:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_ostringstream'
104 | class basic_ostringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:448:12: note: 'template<class SAlloc> int basic_ostringstream(const int&, std::ios_base::openmode)'
448 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:438:10: note: 'int basic_ostringstream(int)'
438 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:432:10: note: 'int basic_ostringstream(const int&, std::ios_base::openmode)'
432 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:461:38: error: expected primary-expression before ',' token
461 | void swap(basic_ostringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:461:46: error: expected primary-expression before ',' token
461 | void swap(basic_ostringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:461:57: error: expected primary-expression before '>' token
461 | void swap(basic_ostringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:461:60: error: 'x' was not declared in this scope
461 | void swap(basic_ostringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:462:13: error: reference to 'basic_ostringstream' is ambiguous
462 | basic_ostringstream<charT, traits, Allocator>& y);
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:104:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_ostringstream'
104 | class basic_ostringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:448:12: note: 'template<class SAlloc> int basic_ostringstream(const int&, std::ios_base::openmode)'
448 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:438:10: note: 'int basic_ostringstream(int)'
438 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:432:10: note: 'int basic_ostringstream(const int&, std::ios_base::openmode)'
432 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:462:38: error: expected primary-expression before ',' token
462 | basic_ostringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:462:46: error: expected primary-expression before ',' token
462 | basic_ostringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:462:57: error: expected primary-expression before '>' token
462 | basic_ostringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:462:60: error: 'y' was not declared in this scope; did you mean 'yn'?
462 | basic_ostringstream<charT, traits, Allocator>& y);
| ^
| yn
p1539.cpp:465:1: error: reference to 'basic_stringbuf' is ambiguous
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:147:12: note: 'template<class SAlloc> int basic_stringbuf(const int&, std::ios_base::openmode)'
147 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:137:10: note: 'int basic_stringbuf(int)'
137 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:130:10: note: 'int basic_stringbuf(const int&, std::ios_base::openmode)'
130 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:127:10: note: 'int basic_stringbuf(std::ios_base::openmode)'
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:467:1: error: expected unqualified-id before 'const_cast'
467 | const_cast<basic_stringbuf<charT, traits, Allocator>*>(addressof(sb)). basic_string<charT, traits, Allocator> str() const &;
| ^~~~~~~~~~
p1539.cpp:469:1: error: expected unqualified-id before 'return'
469 | return rdbuf()->str();
| ^~~~~~
p1539.cpp:471:16: error: 'charT' was not declared in this scope; did you mean 'char'?
471 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~
| char
p1539.cpp:471:22: error: 'traits' was not declared in this scope
471 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~~
p1539.cpp:471:35: error: template argument 1 is invalid
471 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^
p1539.cpp:471:35: error: template argument 2 is invalid
p1539.cpp:471:59: error: non-member function 'int str(const SAlloc&)' cannot have cv-qualifier
471 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~
p1539.cpp:473:1: error: expected unqualified-id before 'return'
473 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~
p1539.cpp:473:39: error: 'charT' was not declared in this scope; did you mean 'char'?
473 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~
| char
p1539.cpp:473:45: error: 'traits' was not declared in this scope
473 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~
p1539.cpp:473:52: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
473 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~~~~
| alloca
p1539.cpp:473:61: error: template argument 1 is invalid
473 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^
p1539.cpp:473:61: error: template argument 2 is invalid
p1539.cpp:473:61: error: template argument 3 is invalid
p1539.cpp:473:69: error: non-member function 'int str()' cannot have ref-qualifier
473 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~
p1539.cpp:475:1: error: expected unqualified-id before 'return'
475 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~
p1539.cpp:475:35: error: 'basic_string_view' does not name a type
475 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~~~~~~~~~~~~
p1539.cpp:477:1: error: expected unqualified-id before 'return'
477 | return rdbuf()->view();
| ^~~~~~
p1539.cpp:478:29: error: 'charT' was not declared in this scope; did you mean 'char'?
478 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~
| char
p1539.cpp:478:36: error: 'traits' was not declared in this scope
478 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~
p1539.cpp:478:44: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
478 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~~~~
| alloca
p1539.cpp:478:53: error: template argument 1 is invalid
478 | void str(const basic_string<charT, traits, Allocator>& s);
| ^
p1539.cpp:478:53: error: template argument 2 is invalid
p1539.cpp:478:53: error: template argument 3 is invalid
p1539.cpp:480:10: error: expected type-specifier before 'str'
480 | rdbuf()->str(s); template<class SAlloc>
| ^~~
p1539.cpp:480:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:481:31: error: 'charT' was not declared in this scope; did you mean 'char'?
481 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~
| char
p1539.cpp:481:38: error: 'traits' was not declared in this scope
481 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~~
p1539.cpp:481:52: error: template argument 1 is invalid
481 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^
p1539.cpp:481:52: error: template argument 2 is invalid
p1539.cpp:483:10: error: expected type-specifier before 'str'
483 | rdbuf()->str(s);
| ^~~
p1539.cpp:483:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:484:23: error: 'charT' was not declared in this scope; did you mean 'char'?
484 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~
| char
p1539.cpp:484:30: error: 'traits' was not declared in this scope
484 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~
p1539.cpp:484:38: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
484 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~~~~
| alloca
p1539.cpp:484:47: error: template argument 1 is invalid
484 | void str(basic_string<charT, traits, Allocator>&& s);
| ^
p1539.cpp:484:47: error: template argument 2 is invalid
p1539.cpp:484:47: error: template argument 3 is invalid
p1539.cpp:484:48: error: expected ',' or '...' before '&&' token
484 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~
p1539.cpp:486:10: error: expected type-specifier before 'str'
486 | rdbuf()->str(std::move(s));
| ^~~
p1539.cpp:486:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:491:34: error: spurious '>>', use '>' to terminate a template argument list
491 | class Allocator = allocator<charT>>
| ^~
p1539.cpp:492:65: error: definition of 'class std::basic_stringstream' inside template parameter list
492 | class basic_stringstream : public basic_iostream<charT, traits> {
| ^
p1539.cpp:491:19: error: two or more data types in declaration of 'type name'
491 | class Allocator = allocator<charT>>
| ^~~~~~~~~~~~~~~~~
p1539.cpp:540:2: error: expected '>' before ';' token
540 | }; }
| ^
p1539.cpp:540:2: error: expected unqualified-id before ';' token
p1539.cpp:544:10: error: ISO C++ forbids declaration of 'basic_stringstream' with no type [-fpermissive]
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:544:1: error: 'explicit' outside class declaration
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~
p1539.cpp:547:22: error: 'charT' was not declared in this scope; did you mean 'char'?
547 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~
| char
p1539.cpp:547:29: error: 'traits' was not declared in this scope
547 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~
p1539.cpp:547:37: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
547 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~~~~
| alloca
p1539.cpp:547:46: error: template argument 1 is invalid
547 | const basic_string<charT, traits, Allocator>& s,
| ^
p1539.cpp:547:46: error: template argument 2 is invalid
p1539.cpp:547:46: error: template argument 3 is invalid
p1539.cpp:546:10: error: ISO C++ forbids declaration of 'basic_stringstream' with no type [-fpermissive]
546 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:546:1: error: 'explicit' outside class declaration
546 | explicit basic_stringstream(
| ^~~~~~~~
p1539.cpp:550:52: error: 'Allocator' does not name a type; did you mean 'alloca'?
550 | basic_stringstream(ios_base::openmode which, const Allocator& a);
| ^~~~~~~~~
| alloca
p1539.cpp:550:65: error: expected constructor, destructor, or type conversion before ';' token
550 | basic_stringstream(ios_base::openmode which, const Allocator& a);
| ^
p1539.cpp:553:16: error: 'charT' was not declared in this scope; did you mean 'char'?
553 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~
| char
p1539.cpp:553:23: error: 'traits' was not declared in this scope
553 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~
p1539.cpp:553:31: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
553 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~~~~
| alloca
p1539.cpp:553:40: error: template argument 1 is invalid
553 | basic_string<charT, traits, Allocator>&& s,
| ^
p1539.cpp:553:40: error: template argument 2 is invalid
p1539.cpp:553:40: error: template argument 3 is invalid
p1539.cpp:553:41: error: expected ',' or '...' before '&&' token
553 | basic_string<charT, traits, Allocator>&& s,
| ^~
p1539.cpp:552:10: error: ISO C++ forbids declaration of 'basic_stringstream' with no type [-fpermissive]
552 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:552:1: error: 'explicit' outside class declaration
552 | explicit basic_stringstream(
| ^~~~~~~~
p1539.cpp:558:20: error: 'charT' was not declared in this scope; did you mean 'char'?
558 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~
| char
p1539.cpp:558:27: error: 'traits' was not declared in this scope
558 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~~
p1539.cpp:558:41: error: template argument 1 is invalid
558 | const basic_string<charT, traits, SAlloc>& s,
| ^
p1539.cpp:558:41: error: template argument 2 is invalid
p1539.cpp:559:33: error: 'Allocator' does not name a type; did you mean 'alloca'?
559 | ios_base::openmode which, const Allocator& a);
| ^~~~~~~~~
| alloca
p1539.cpp:559:46: error: expected constructor, destructor, or type conversion before ';' token
559 | ios_base::openmode which, const Allocator& a);
| ^
p1539.cpp:563:20: error: 'charT' was not declared in this scope; did you mean 'char'?
563 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~
| char
p1539.cpp:563:27: error: 'traits' was not declared in this scope
563 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~~
p1539.cpp:563:41: error: template argument 1 is invalid
563 | const basic_string<charT, traits, SAlloc>& s,
| ^
p1539.cpp:563:41: error: template argument 2 is invalid
p1539.cpp:562:12: error: ISO C++ forbids declaration of 'basic_stringstream' with no type [-fpermissive]
562 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:562:3: error: 'explicit' outside class declaration
562 | explicit basic_stringstream(
| ^~~~~~~~
p1539.cpp:567:19: error: expected constructor, destructor, or type conversion before '(' token
567 | basic_stringstream(basic_stringstream&& rhs);
| ^
p1539.cpp:570:6: error: variable or field 'swap' declared void
570 | void swap(basic_stringstream& rhs);
| ^~~~
p1539.cpp:570:11: error: reference to 'basic_stringstream' is ambiguous
570 | void swap(basic_stringstream& rhs);
| ^~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:108:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringstream'
108 | class basic_stringstream;
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:562:12: note: 'template<class SAlloc> int basic_stringstream(const int&, std::ios_base::openmode)'
562 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:552:10: note: 'int basic_stringstream(int)'
552 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:546:10: note: 'int basic_stringstream(const int&, std::ios_base::openmode)'
546 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:544:10: note: 'int basic_stringstream(std::ios_base::openmode)'
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:570:31: error: 'rhs' was not declared in this scope
570 | void swap(basic_stringstream& rhs);
| ^~~
p1539.cpp:572:16: error: 'charT' was not declared in this scope; did you mean 'char'?
572 | basic_iostream<charT,traits>::swap(rhs);
| ^~~~~
| char
p1539.cpp:572:22: error: 'traits' was not declared in this scope
572 | basic_iostream<charT,traits>::swap(rhs);
| ^~~~~~
p1539.cpp:572:28: error: template argument 1 is invalid
572 | basic_iostream<charT,traits>::swap(rhs);
| ^
p1539.cpp:572:28: error: template argument 2 is invalid
p1539.cpp:572:31: error: redefinition of 'int swap'
572 | basic_iostream<charT,traits>::swap(rhs);
| ^~~~
p1539.cpp:345:31: note: 'int swap' previously defined here
345 | basic_istream<charT, traits>::swap(rhs);
| ^~~~
p1539.cpp:572:36: error: 'rhs' was not declared in this scope
572 | basic_iostream<charT,traits>::swap(rhs);
| ^~~
p1539.cpp:573:3: error: 'sb' does not name a type
573 | sb.swap(rhs.sb);
| ^~
p1539.cpp:575:8: error: variable or field 'swap' declared void
575 | void swap(basic_stringstream<charT, traits, Allocator>& x,
| ^~~~
p1539.cpp:575:13: error: reference to 'basic_stringstream' is ambiguous
575 | void swap(basic_stringstream<charT, traits, Allocator>& x,
| ^~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:108:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringstream'
108 | class basic_stringstream;
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:562:12: note: 'template<class SAlloc> int basic_stringstream(const int&, std::ios_base::openmode)'
562 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:552:10: note: 'int basic_stringstream(int)'
552 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:546:10: note: 'int basic_stringstream(const int&, std::ios_base::openmode)'
546 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:544:10: note: 'int basic_stringstream(std::ios_base::openmode)'
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:575:37: error: expected primary-expression before ',' token
575 | void swap(basic_stringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:575:45: error: expected primary-expression before ',' token
575 | void swap(basic_stringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:575:56: error: expected primary-expression before '>' token
575 | void swap(basic_stringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:575:59: error: 'x' was not declared in this scope
575 | void swap(basic_stringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:576:13: error: reference to 'basic_stringstream' is ambiguous
576 | basic_stringstream<charT, traits, Allocator>& y);
| ^~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:108:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringstream'
108 | class basic_stringstream;
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:562:12: note: 'template<class SAlloc> int basic_stringstream(const int&, std::ios_base::openmode)'
562 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:552:10: note: 'int basic_stringstream(int)'
552 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:546:10: note: 'int basic_stringstream(const int&, std::ios_base::openmode)'
546 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:544:10: note: 'int basic_stringstream(std::ios_base::openmode)'
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:576:37: error: expected primary-expression before ',' token
576 | basic_stringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:576:45: error: expected primary-expression before ',' token
576 | basic_stringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:576:56: error: expected primary-expression before '>' token
576 | basic_stringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:576:59: error: 'y' was not declared in this scope; did you mean 'yn'?
576 | basic_stringstream<charT, traits, Allocator>& y);
| ^
| yn
p1539.cpp:579:1: error: reference to 'basic_stringbuf' is ambiguous
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:147:12: note: 'template<class SAlloc> int basic_stringbuf(const int&, std::ios_base::openmode)'
147 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:137:10: note: 'int basic_stringbuf(int)'
137 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:130:10: note: 'int basic_stringbuf(const int&, std::ios_base::openmode)'
130 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:127:10: note: 'int basic_stringbuf(std::ios_base::openmode)'
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:581:14: error: 'charT' was not declared in this scope; did you mean 'char'?
581 | basic_string<charT, traits, Allocator> str() const &;
| ^~~~~
| char
p1539.cpp:581:21: error: 'traits' was not declared in this scope
581 | basic_string<charT, traits, Allocator> str() const &;
| ^~~~~~
p1539.cpp:581:29: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
581 | basic_string<charT, traits, Allocator> str() const &;
| ^~~~~~~~~
| alloca
p1539.cpp:581:38: error: template argument 1 is invalid
581 | basic_string<charT, traits, Allocator> str() const &;
| ^
p1539.cpp:581:38: error: template argument 2 is invalid
p1539.cpp:581:38: error: template argument 3 is invalid
p1539.cpp:581:52: error: non-member function 'int str()' cannot have cv-qualifier
581 | basic_string<charT, traits, Allocator> str() const &;
| ^
p1539.cpp:581:52: error: non-member function 'int str()' cannot have ref-qualifier
p1539.cpp:583:16: error: 'charT' was not declared in this scope; did you mean 'char'?
583 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~
| char
p1539.cpp:583:22: error: 'traits' was not declared in this scope
583 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~~
p1539.cpp:583:29: error: 'SAlloc' was not declared in this scope; did you mean 'valloc'?
583 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~~
| valloc
p1539.cpp:583:35: error: template argument 1 is invalid
583 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^
p1539.cpp:583:35: error: template argument 2 is invalid
p1539.cpp:583:35: error: template argument 3 is invalid
p1539.cpp:583:47: error: 'SAlloc' does not name a type
583 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~~
p1539.cpp:583:59: error: non-member function 'int str(const int&)' cannot have cv-qualifier
583 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~
p1539.cpp:583:37: error: ambiguating new declaration of 'int str(const int&)'
583 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~
p1539.cpp:478:6: note: old declaration 'void str(const int&)'
478 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~
p1539.cpp:585:1: error: expected unqualified-id before 'return'
585 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~
p1539.cpp:585:39: error: 'charT' was not declared in this scope; did you mean 'char'?
585 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~
| char
p1539.cpp:585:45: error: 'traits' was not declared in this scope
585 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~
p1539.cpp:585:52: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
585 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~~~~
| alloca
p1539.cpp:585:61: error: template argument 1 is invalid
585 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^
p1539.cpp:585:61: error: template argument 2 is invalid
p1539.cpp:585:61: error: template argument 3 is invalid
p1539.cpp:585:69: error: non-member function 'int str()' cannot have ref-qualifier
585 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~
p1539.cpp:587:1: error: expected unqualified-id before 'return'
587 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~
p1539.cpp:587:35: error: 'basic_string_view' does not name a type
587 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~~~~~~~~~~~~
p1539.cpp:589:1: error: expected unqualified-id before 'return'
589 | return rdbuf()->view();
| ^~~~~~
p1539.cpp:590:29: error: 'charT' was not declared in this scope; did you mean 'char'?
590 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~
| char
p1539.cpp:590:36: error: 'traits' was not declared in this scope
590 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~
p1539.cpp:590:44: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
590 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~~~~
| alloca
p1539.cpp:590:53: error: template argument 1 is invalid
590 | void str(const basic_string<charT, traits, Allocator>& s);
| ^
p1539.cpp:590:53: error: template argument 2 is invalid
p1539.cpp:590:53: error: template argument 3 is invalid
p1539.cpp:592:10: error: expected type-specifier before 'str'
592 | rdbuf()->str(s);
| ^~~
p1539.cpp:592:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:594:31: error: 'charT' was not declared in this scope; did you mean 'char'?
594 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~
| char
p1539.cpp:594:38: error: 'traits' was not declared in this scope
594 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~~
p1539.cpp:594:52: error: template argument 1 is invalid
594 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^
p1539.cpp:594:52: error: template argument 2 is invalid
p1539.cpp:596:10: error: expected type-specifier before 'str'
596 | rdbuf()->str(s);
| ^~~
p1539.cpp:596:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:597:23: error: 'charT' was not declared in this scope; did you mean 'char'?
597 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~
| char
p1539.cpp:597:30: error: 'traits' was not declared in this scope
597 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~
p1539.cpp:597:38: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
597 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~~~~
| alloca
p1539.cpp:597:47: error: template argument 1 is invalid
597 | void str(basic_string<charT, traits, Allocator>&& s);
| ^
p1539.cpp:597:47: error: template argument 2 is invalid
p1539.cpp:597:47: error: template argument 3 is invalid
p1539.cpp:597:48: error: expected ',' or '...' before '&&' token
597 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~
p1539.cpp:599:10: error: expected type-specifier before 'str'
599 | rdbuf()->str(std::move(s));
| ^~~
p1539.cpp:599:10: error: expected constructor, destructor, or type conversion before 'str'
$ g++ p1539.cpp -std=2b -o p1539g -I. -Wall
p1539.cpp:334:2: error: too many decimal points in number
334 | (31.8.2.2).
| ^~~~~~~~
p1539.cpp:453:2: error: too many decimal points in number
453 | (31.8.2.2). basic_ostringstream(basic_ostringstream&& rhs);
| ^~~~~~~~
p1539.cpp:15:1: error: 'String' does not name a type
15 | String-based streams Header <sstream> synopsis
| ^~~~~~
p1539.cpp:92:42: error: 'see' was not declared in this scope
92 | void swap(basic_stringbuf& rhs) noexcept(see below);
| ^~~
p1539.cpp:92:46: error: expected ')' before 'below'
92 | void swap(basic_stringbuf& rhs) noexcept(see below);
| ^~~~~
p1539.cpp:92:41: note: to match this '('
92 | void swap(basic_stringbuf& rhs) noexcept(see below);
| ^
p1539.cpp:127:10: error: reference to 'basic_stringbuf' is ambiguous
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
In file included from /usr/local/include/c++/12.1.0/ios:38,
from /usr/local/include/c++/12.1.0/ostream:38,
from /usr/local/include/c++/12.1.0/iostream:39,
from N4910.h:2,
from p1539.cpp:10:
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:127:10: error: ISO C++ forbids declaration of 'basic_stringbuf' with no type [-fpermissive]
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:127:1: error: 'explicit' outside class declaration
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~
p1539.cpp:131:22: error: 'charT' was not declared in this scope; did you mean 'char'?
131 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~
| char
p1539.cpp:131:29: error: 'traits' was not declared in this scope
131 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~
p1539.cpp:131:37: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
131 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~~~~
| alloca
p1539.cpp:131:46: error: template argument 1 is invalid
131 | const basic_string<charT, traits, Allocator>& s,
| ^
p1539.cpp:131:46: error: template argument 2 is invalid
p1539.cpp:131:46: error: template argument 3 is invalid
p1539.cpp:130:10: error: reference to 'basic_stringbuf' is ambiguous
130 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:127:10: note: 'int basic_stringbuf(std::ios_base::openmode)'
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:130:10: error: ISO C++ forbids declaration of 'basic_stringbuf' with no type [-fpermissive]
130 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:130:1: error: 'explicit' outside class declaration
130 | explicit basic_stringbuf(
| ^~~~~~~~
p1539.cpp:134:49: error: 'Allocator' does not name a type; did you mean 'alloca'?
134 | basic_stringbuf(ios_base::openmode which, const Allocator &a);
| ^~~~~~~~~
| alloca
p1539.cpp:134:1: error: reference to 'basic_stringbuf' is ambiguous
134 | basic_stringbuf(ios_base::openmode which, const Allocator &a);
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:130:10: note: 'int basic_stringbuf(const int&, std::ios_base::openmode)'
130 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:127:10: note: 'int basic_stringbuf(std::ios_base::openmode)'
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:134:62: error: expected constructor, destructor, or type conversion before ';' token
134 | basic_stringbuf(ios_base::openmode which, const Allocator &a);
| ^
p1539.cpp:138:16: error: 'charT' was not declared in this scope; did you mean 'char'?
138 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~
| char
p1539.cpp:138:23: error: 'traits' was not declared in this scope
138 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~
p1539.cpp:138:31: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
138 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~~~~
| alloca
p1539.cpp:138:40: error: template argument 1 is invalid
138 | basic_string<charT, traits, Allocator>&& s,
| ^
p1539.cpp:138:40: error: template argument 2 is invalid
p1539.cpp:138:40: error: template argument 3 is invalid
p1539.cpp:137:10: error: reference to 'basic_stringbuf' is ambiguous
137 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:130:10: note: 'int basic_stringbuf(const int&, std::ios_base::openmode)'
130 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:127:10: note: 'int basic_stringbuf(std::ios_base::openmode)'
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:137:10: error: ISO C++ forbids declaration of 'basic_stringbuf' with no type [-fpermissive]
137 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:137:1: error: 'explicit' outside class declaration
137 | explicit basic_stringbuf(
| ^~~~~~~~
p1539.cpp:143:24: error: 'charT' was not declared in this scope; did you mean 'char'?
143 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~
| char
p1539.cpp:143:31: error: 'traits' was not declared in this scope
143 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~~
p1539.cpp:143:45: error: template argument 1 is invalid
143 | const basic_string<charT, traits, SAlloc>& s,
| ^
p1539.cpp:143:45: error: template argument 2 is invalid
p1539.cpp:144:33: error: 'Allocator' does not name a type; did you mean 'alloca'?
144 | ios_base::openmode which, const Allocator &a);
| ^~~~~~~~~
| alloca
p1539.cpp:142:3: error: reference to 'basic_stringbuf' is ambiguous
142 | basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:137:10: note: 'int basic_stringbuf(int&&, std::ios_base::openmode)'
137 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:130:10: note: 'int basic_stringbuf(const int&, std::ios_base::openmode)'
130 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:127:10: note: 'int basic_stringbuf(std::ios_base::openmode)'
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:144:46: error: expected constructor, destructor, or type conversion before ';' token
144 | ios_base::openmode which, const Allocator &a);
| ^
p1539.cpp:148:20: error: 'charT' was not declared in this scope; did you mean 'char'?
148 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~
| char
p1539.cpp:148:27: error: 'traits' was not declared in this scope
148 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~~
p1539.cpp:148:41: error: template argument 1 is invalid
148 | const basic_string<charT, traits, SAlloc>& s,
| ^
p1539.cpp:148:41: error: template argument 2 is invalid
p1539.cpp:147:12: error: reference to 'basic_stringbuf' is ambiguous
147 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:137:10: note: 'int basic_stringbuf(int&&, std::ios_base::openmode)'
137 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:130:10: note: 'int basic_stringbuf(const int&, std::ios_base::openmode)'
130 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:127:10: note: 'int basic_stringbuf(std::ios_base::openmode)'
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:147:12: error: ISO C++ forbids declaration of 'basic_stringbuf' with no type [-fpermissive]
147 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:147:3: error: 'explicit' outside class declaration
147 | explicit basic_stringbuf(
| ^~~~~~~~
p1539.cpp:152:16: error: expected constructor, destructor, or type conversion before '(' token
152 | basic_stringbuf(basic_stringbuf&& rhs, const Allocator& a);
| ^
p1539.cpp:169:1: error: reference to 'basic_stringbuf' is ambiguous
169 | basic_stringbuf& operator=(basic_stringbuf&& rhs);
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:147:12: note: 'template<class SAlloc> int basic_stringbuf(const int&, std::ios_base::openmode)'
147 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:137:10: note: 'int basic_stringbuf(int&&, std::ios_base::openmode)'
137 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:130:10: note: 'int basic_stringbuf(const int&, std::ios_base::openmode)'
130 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:127:10: note: 'int basic_stringbuf(std::ios_base::openmode)'
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:171:1: error: 'Returns' does not name a type
171 | Returns: *this.
| ^~~~~~~
p1539.cpp:174:8: error: found ':' in nested-name-specifier, expected '::'
174 | Effects: Exchanges the state of *this and rhs.
| ^
| ::
p1539.cpp:174:1: error: 'Effects' does not name a type
174 | Effects: Exchanges the state of *this and rhs.
| ^~~~~~~
p1539.cpp:189:1: error: 'allocator_type' does not name a type
189 | allocator_type get_allocator() const noexcept;
| ^~~~~~~~~~~~~~
p1539.cpp:191:14: error: 'charT' was not declared in this scope; did you mean 'char'?
191 | basic_string<charT, traits, Allocator> str() const &;
| ^~~~~
| char
p1539.cpp:191:21: error: 'traits' was not declared in this scope
191 | basic_string<charT, traits, Allocator> str() const &;
| ^~~~~~
p1539.cpp:191:29: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
191 | basic_string<charT, traits, Allocator> str() const &;
| ^~~~~~~~~
| alloca
p1539.cpp:191:38: error: template argument 1 is invalid
191 | basic_string<charT, traits, Allocator> str() const &;
| ^
p1539.cpp:191:38: error: template argument 2 is invalid
p1539.cpp:191:38: error: template argument 3 is invalid
p1539.cpp:191:52: error: non-member function 'int str()' cannot have cv-qualifier
191 | basic_string<charT, traits, Allocator> str() const &;
| ^
p1539.cpp:191:52: error: non-member function 'int str()' cannot have ref-qualifier
p1539.cpp:193:1: error: expected unqualified-id before 'return'
193 | return basic_string<charT, traits, Allocator>(view(), get_allocator());
| ^~~~~~
p1539.cpp:195:16: error: 'charT' was not declared in this scope; did you mean 'char'?
195 | basic_string<charT, traits, SAlloc> str(const SAlloc& sa) const;
| ^~~~~
| char
p1539.cpp:195:23: error: 'traits' was not declared in this scope
195 | basic_string<charT, traits, SAlloc> str(const SAlloc& sa) const;
| ^~~~~~
p1539.cpp:195:37: error: template argument 1 is invalid
195 | basic_string<charT, traits, SAlloc> str(const SAlloc& sa) const;
| ^
p1539.cpp:195:37: error: template argument 2 is invalid
p1539.cpp:195:61: error: non-member function 'int str(const SAlloc&)' cannot have cv-qualifier
195 | basic_string<charT, traits, SAlloc> str(const SAlloc& sa) const;
| ^~~~~
p1539.cpp:197:8: error: expected unqualified-id before 'return'
197 | return basic_string<charT, traits, SAlloc>(view(), sa);
| ^~~~~~
p1539.cpp:198:14: error: 'charT' was not declared in this scope; did you mean 'char'?
198 | basic_string<charT, traits, Allocator> str() &&;
| ^~~~~
| char
p1539.cpp:198:21: error: 'traits' was not declared in this scope
198 | basic_string<charT, traits, Allocator> str() &&;
| ^~~~~~
p1539.cpp:198:29: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
198 | basic_string<charT, traits, Allocator> str() &&;
| ^~~~~~~~~
| alloca
p1539.cpp:198:38: error: template argument 1 is invalid
198 | basic_string<charT, traits, Allocator> str() &&;
| ^
p1539.cpp:198:38: error: template argument 2 is invalid
p1539.cpp:198:38: error: template argument 3 is invalid
p1539.cpp:198:46: error: non-member function 'int str()' cannot have ref-qualifier
198 | basic_string<charT, traits, Allocator> str() &&;
| ^~
p1539.cpp:201:19: error: 'charT' was not declared in this scope; did you mean 'char'?
201 | basic_string_view<charT, traits> view() const noexcept;
| ^~~~~
| char
p1539.cpp:201:26: error: 'traits' was not declared in this scope
201 | basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~
p1539.cpp:201:32: error: template argument 1 is invalid
201 | basic_string_view<charT, traits> view() const noexcept;
| ^
p1539.cpp:201:32: error: template argument 2 is invalid
p1539.cpp:201:47: error: non-member function 'int view()' cannot have cv-qualifier
201 | basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~~~
p1539.cpp:207:29: error: 'charT' was not declared in this scope; did you mean 'char'?
207 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~
| char
p1539.cpp:207:36: error: 'traits' was not declared in this scope
207 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~
p1539.cpp:207:44: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
207 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~~~~
| alloca
p1539.cpp:207:53: error: template argument 1 is invalid
207 | void str(const basic_string<charT, traits, Allocator>& s);
| ^
p1539.cpp:207:53: error: template argument 2 is invalid
p1539.cpp:207:53: error: template argument 3 is invalid
p1539.cpp:209:8: error: 'buf' does not name a type
209 | buf = s;
| ^~~
p1539.cpp:210:23: error: expected constructor, destructor, or type conversion before ';' token
210 | init_buf_ptrs();
| ^
p1539.cpp:212:31: error: 'charT' was not declared in this scope; did you mean 'char'?
212 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~
| char
p1539.cpp:212:38: error: 'traits' was not declared in this scope
212 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~~
p1539.cpp:212:52: error: template argument 1 is invalid
212 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^
p1539.cpp:212:52: error: template argument 2 is invalid
p1539.cpp:215:8: error: 'buf' does not name a type
215 | buf = s;
| ^~~
p1539.cpp:216:23: error: expected constructor, destructor, or type conversion before ';' token
216 | init_buf_ptrs();
| ^
p1539.cpp:217:23: error: 'charT' was not declared in this scope; did you mean 'char'?
217 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~
| char
p1539.cpp:217:30: error: 'traits' was not declared in this scope
217 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~
p1539.cpp:217:38: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
217 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~~~~
| alloca
p1539.cpp:217:47: error: template argument 1 is invalid
217 | void str(basic_string<charT, traits, Allocator>&& s);
| ^
p1539.cpp:217:47: error: template argument 2 is invalid
p1539.cpp:217:47: error: template argument 3 is invalid
p1539.cpp:219:23: error: expected constructor, destructor, or type conversion before ';' token
219 | init_buf_ptrs();
| ^
p1539.cpp:221:1: error: 'int_type' does not name a type
221 | int_type underflow() override;
| ^~~~~~~~
p1539.cpp:223:1: error: 'int_type' does not name a type
223 | int_type pbackfail(int_type c = traits::eof()) override;
| ^~~~~~~~
p1539.cpp:228:1: error: 'putback' does not name a type
228 | putback position available, and if mode & ios_base::out is nonzero, assigns c to *--gptr().
| ^~~~~~~
p1539.cpp:243:1: error: 'pos_type' does not name a type
243 | pos_type seekpos(pos_type sp,
| ^~~~~~~~
p1539.cpp:253:2: error: 'Condition' does not name a type
253 | Condition newoff Value
| ^~~~~~~~~
p1539.cpp:261:17: error: 'charT' was not declared in this scope; did you mean 'char'?
261 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);
| ^~~~~
| char
p1539.cpp:261:24: error: 'traits' was not declared in this scope
261 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);
| ^~~~~~
p1539.cpp:261:30: error: template argument 1 is invalid
261 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);
| ^
p1539.cpp:261:30: error: template argument 2 is invalid
p1539.cpp:261:40: error: 'int* setbuf' redeclared as different kind of entity
261 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);
| ^~~~~
In file included from /usr/local/include/c++/12.1.0/cstdio:42,
from /usr/local/include/c++/12.1.0/ext/string_conversions.h:43,
from /usr/local/include/c++/12.1.0/bits/basic_string.h:3960,
from /usr/local/include/c++/12.1.0/string:53,
from /usr/local/include/c++/12.1.0/bits/locale_classes.h:40,
from /usr/local/include/c++/12.1.0/bits/ios_base.h:41,
from /usr/local/include/c++/12.1.0/ios:42:
/usr/include/stdio.h:304:13: note: previous declaration 'void setbuf(FILE*, char*)'
304 | extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __THROW;
| ^~~~~~
p1539.cpp:261:40: error: 'charT' was not declared in this scope; did you mean 'char'?
261 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);
| ^~~~~
| char
p1539.cpp:261:47: error: 's' was not declared in this scope
261 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);
| ^
p1539.cpp:261:61: error: expected primary-expression before 'n'
261 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);
| ^
p1539.cpp:304:1: error: reference to 'basic_stringbuf' is ambiguous
304 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const; basic_string<charT, traits, Allocator> str() const &; template<class SAlloc>
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
p1539.cpp:313:1: error: reference to 'basic_stringbuf' is ambiguous
313 | basic_stringbuf<charT, traits, Allocator> sb; // exposition only
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
p1539.cpp:317:10: error: reference to 'basic_istringstream' is ambiguous
317 | explicit basic_istringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:268:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_istringstream'
268 | class basic_istringstream : public basic_istream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:100:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_istringstream'
100 | class basic_istringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:317:10: error: ISO C++ forbids declaration of 'basic_istringstream' with no type [-fpermissive]
317 | explicit basic_istringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:317:1: error: 'explicit' outside class declaration
317 | explicit basic_istringstream(ios_base::openmode which);
| ^~~~~~~~
p1539.cpp:320:22: error: 'charT' was not declared in this scope; did you mean 'char'?
320 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~
| char
p1539.cpp:320:29: error: 'traits' was not declared in this scope
320 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~
p1539.cpp:320:37: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
320 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~~~~
| alloca
p1539.cpp:320:46: error: template argument 1 is invalid
320 | const basic_string<charT, traits, Allocator>& s,
| ^
p1539.cpp:320:46: error: template argument 2 is invalid
p1539.cpp:320:46: error: template argument 3 is invalid
p1539.cpp:319:10: error: reference to 'basic_istringstream' is ambiguous
319 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:268:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_istringstream'
268 | class basic_istringstream : public basic_istream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:100:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_istringstream'
100 | class basic_istringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:317:10: note: 'int basic_istringstream(std::ios_base::openmode)'
317 | explicit basic_istringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:319:10: error: ISO C++ forbids declaration of 'basic_istringstream' with no type [-fpermissive]
319 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:319:1: error: 'explicit' outside class declaration
319 | explicit basic_istringstream(
| ^~~~~~~~
p1539.cpp:323:53: error: 'Allocator' does not name a type; did you mean 'alloca'?
323 | basic_istringstream(ios_base::openmode which, const Allocator& a);
| ^~~~~~~~~
| alloca
p1539.cpp:323:1: error: reference to 'basic_istringstream' is ambiguous
323 | basic_istringstream(ios_base::openmode which, const Allocator& a);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:268:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_istringstream'
268 | class basic_istringstream : public basic_istream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:100:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_istringstream'
100 | class basic_istringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:319:10: note: 'int basic_istringstream(const int&, std::ios_base::openmode)'
319 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:317:10: note: 'int basic_istringstream(std::ios_base::openmode)'
317 | explicit basic_istringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:323:66: error: expected constructor, destructor, or type conversion before ';' token
323 | basic_istringstream(ios_base::openmode which, const Allocator& a);
| ^
p1539.cpp:326:16: error: 'charT' was not declared in this scope; did you mean 'char'?
326 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~
| char
p1539.cpp:326:23: error: 'traits' was not declared in this scope
326 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~
p1539.cpp:326:31: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
326 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~~~~
| alloca
p1539.cpp:326:40: error: template argument 1 is invalid
326 | basic_string<charT, traits, Allocator>&& s,
| ^
p1539.cpp:326:40: error: template argument 2 is invalid
p1539.cpp:326:40: error: template argument 3 is invalid
p1539.cpp:325:10: error: reference to 'basic_istringstream' is ambiguous
325 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:268:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_istringstream'
268 | class basic_istringstream : public basic_istream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:100:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_istringstream'
100 | class basic_istringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:319:10: note: 'int basic_istringstream(const int&, std::ios_base::openmode)'
319 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:317:10: note: 'int basic_istringstream(std::ios_base::openmode)'
317 | explicit basic_istringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:325:10: error: ISO C++ forbids declaration of 'basic_istringstream' with no type [-fpermissive]
325 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:325:1: error: 'explicit' outside class declaration
325 | explicit basic_istringstream(
| ^~~~~~~~
p1539.cpp:331:20: error: 'charT' was not declared in this scope; did you mean 'char'?
331 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~
| char
p1539.cpp:331:27: error: 'traits' was not declared in this scope
331 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~~
p1539.cpp:331:41: error: template argument 1 is invalid
331 | const basic_string<charT, traits, SAlloc>& s,
| ^
p1539.cpp:331:41: error: template argument 2 is invalid
p1539.cpp:332:33: error: 'Allocator' does not name a type; did you mean 'alloca'?
332 | ios_base::openmode which, const Allocator& a);
| ^~~~~~~~~
| alloca
p1539.cpp:330:3: error: reference to 'basic_istringstream' is ambiguous
330 | basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:268:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_istringstream'
268 | class basic_istringstream : public basic_istream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:100:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_istringstream'
100 | class basic_istringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:325:10: note: 'int basic_istringstream(int&&, std::ios_base::openmode)'
325 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:319:10: note: 'int basic_istringstream(const int&, std::ios_base::openmode)'
319 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:317:10: note: 'int basic_istringstream(std::ios_base::openmode)'
317 | explicit basic_istringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:332:46: error: expected constructor, destructor, or type conversion before ';' token
332 | ios_base::openmode which, const Allocator& a);
| ^
p1539.cpp:334:2: error: expected unqualified-id before numeric constant
334 | (31.8.2.2).
| ^~~~~~~~
p1539.cpp:334:2: error: expected ')' before numeric constant
334 | (31.8.2.2).
| ~^~~~~~~~
| )
p1539.cpp:340:20: error: expected constructor, destructor, or type conversion before '(' token
340 | basic_istringstream(basic_istringstream&& rhs);
| ^
p1539.cpp:343:6: error: variable or field 'swap' declared void
343 | void swap(basic_istringstream& rhs);
| ^~~~
p1539.cpp:343:11: error: reference to 'basic_istringstream' is ambiguous
343 | void swap(basic_istringstream& rhs);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:268:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_istringstream'
268 | class basic_istringstream : public basic_istream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:100:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_istringstream'
100 | class basic_istringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:325:10: note: 'int basic_istringstream(int&&, std::ios_base::openmode)'
325 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:319:10: note: 'int basic_istringstream(const int&, std::ios_base::openmode)'
319 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:317:10: note: 'int basic_istringstream(std::ios_base::openmode)'
317 | explicit basic_istringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:343:32: error: 'rhs' was not declared in this scope
343 | void swap(basic_istringstream& rhs);
| ^~~
p1539.cpp:345:15: error: 'charT' was not declared in this scope; did you mean 'char'?
345 | basic_istream<charT, traits>::swap(rhs);
| ^~~~~
| char
p1539.cpp:345:22: error: 'traits' was not declared in this scope
345 | basic_istream<charT, traits>::swap(rhs);
| ^~~~~~
p1539.cpp:345:28: error: template argument 1 is invalid
345 | basic_istream<charT, traits>::swap(rhs);
| ^
p1539.cpp:345:28: error: template argument 2 is invalid
p1539.cpp:345:36: error: 'rhs' was not declared in this scope
345 | basic_istream<charT, traits>::swap(rhs);
| ^~~
p1539.cpp:346:3: error: 'sb' does not name a type
346 | sb.swap(rhs.sb);
| ^~
p1539.cpp:348:8: error: variable or field 'swap' declared void
348 | void swap(basic_istringstream<charT, traits, Allocator>& x,
| ^~~~
p1539.cpp:348:13: error: reference to 'basic_istringstream' is ambiguous
348 | void swap(basic_istringstream<charT, traits, Allocator>& x,
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:268:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_istringstream'
268 | class basic_istringstream : public basic_istream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:100:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_istringstream'
100 | class basic_istringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:325:10: note: 'int basic_istringstream(int&&, std::ios_base::openmode)'
325 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:319:10: note: 'int basic_istringstream(const int&, std::ios_base::openmode)'
319 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:317:10: note: 'int basic_istringstream(std::ios_base::openmode)'
317 | explicit basic_istringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:348:38: error: expected primary-expression before ',' token
348 | void swap(basic_istringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:348:46: error: expected primary-expression before ',' token
348 | void swap(basic_istringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:348:57: error: expected primary-expression before '>' token
348 | void swap(basic_istringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:348:60: error: 'x' was not declared in this scope
348 | void swap(basic_istringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:349:13: error: reference to 'basic_istringstream' is ambiguous
349 | basic_istringstream<charT, traits, Allocator>& y);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:268:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_istringstream'
268 | class basic_istringstream : public basic_istream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:100:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_istringstream'
100 | class basic_istringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:325:10: note: 'int basic_istringstream(int&&, std::ios_base::openmode)'
325 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:319:10: note: 'int basic_istringstream(const int&, std::ios_base::openmode)'
319 | explicit basic_istringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:317:10: note: 'int basic_istringstream(std::ios_base::openmode)'
317 | explicit basic_istringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:349:38: error: expected primary-expression before ',' token
349 | basic_istringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:349:46: error: expected primary-expression before ',' token
349 | basic_istringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:349:57: error: expected primary-expression before '>' token
349 | basic_istringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:349:60: error: 'y' was not declared in this scope; did you mean 'yn'?
349 | basic_istringstream<charT, traits, Allocator>& y);
| ^
| yn
p1539.cpp:352:17: error: 'charT' was not declared in this scope; did you mean 'char'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:352:24: error: 'traits' was not declared in this scope
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:352:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:352:17: error: 'charT' was not declared in this scope; did you mean 'char'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:352:24: error: 'traits' was not declared in this scope
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:352:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:352:17: error: 'charT' was not declared in this scope; did you mean 'char'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:352:24: error: 'traits' was not declared in this scope
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:352:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:352:17: error: 'charT' was not declared in this scope; did you mean 'char'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:352:24: error: 'traits' was not declared in this scope
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:352:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:352:17: error: 'charT' was not declared in this scope; did you mean 'char'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:352:24: error: 'traits' was not declared in this scope
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:352:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:352:17: error: 'charT' was not declared in this scope; did you mean 'char'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:352:24: error: 'traits' was not declared in this scope
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:352:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:352:17: error: 'charT' was not declared in this scope; did you mean 'char'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:352:24: error: 'traits' was not declared in this scope
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:352:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:352:17: error: 'charT' was not declared in this scope; did you mean 'char'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:352:24: error: 'traits' was not declared in this scope
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:352:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:352:17: error: 'charT' was not declared in this scope; did you mean 'char'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:352:24: error: 'traits' was not declared in this scope
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:352:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:352:1: error: reference to 'basic_stringbuf' is ambiguous
352 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:147:12: note: 'template<class SAlloc> int basic_stringbuf(const int&, std::ios_base::openmode)'
147 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:137:10: note: 'int basic_stringbuf(int&&, std::ios_base::openmode)'
137 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:130:10: note: 'int basic_stringbuf(const int&, std::ios_base::openmode)'
130 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:127:10: note: 'int basic_stringbuf(std::ios_base::openmode)'
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:354:1: error: expected unqualified-id before 'const_cast'
354 | const_cast<basic_stringbuf<charT, traits, Allocator>*>(addressof(sb)).
| ^~~~~~~~~~
p1539.cpp:357:1: error: expected unqualified-id before 'return'
357 | return rdbuf()->str(); template<class SAlloc>
| ^~~~~~
p1539.cpp:358:16: error: 'charT' was not declared in this scope; did you mean 'char'?
358 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~
| char
p1539.cpp:358:22: error: 'traits' was not declared in this scope
358 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~~
p1539.cpp:358:35: error: template argument 1 is invalid
358 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^
p1539.cpp:358:35: error: template argument 2 is invalid
p1539.cpp:358:59: error: non-member function 'int str(const SAlloc&)' cannot have cv-qualifier
358 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~
p1539.cpp:360:1: error: expected unqualified-id before 'return'
360 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~
p1539.cpp:360:39: error: 'charT' was not declared in this scope; did you mean 'char'?
360 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~
| char
p1539.cpp:360:45: error: 'traits' was not declared in this scope
360 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~
p1539.cpp:360:52: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
360 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~~~~
| alloca
p1539.cpp:360:61: error: template argument 1 is invalid
360 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^
p1539.cpp:360:61: error: template argument 2 is invalid
p1539.cpp:360:61: error: template argument 3 is invalid
p1539.cpp:360:69: error: non-member function 'int str()' cannot have ref-qualifier
360 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~
p1539.cpp:362:1: error: expected unqualified-id before 'return'
362 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~
p1539.cpp:362:53: error: 'charT' was not declared in this scope; did you mean 'char'?
362 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~
| char
p1539.cpp:362:60: error: 'traits' was not declared in this scope
362 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~
p1539.cpp:362:66: error: template argument 1 is invalid
362 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^
p1539.cpp:362:66: error: template argument 2 is invalid
p1539.cpp:362:81: error: non-member function 'int view()' cannot have cv-qualifier
362 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~~~
p1539.cpp:364:1: error: expected unqualified-id before 'return'
364 | return rdbuf()->view();
| ^~~~~~
p1539.cpp:365:29: error: 'charT' was not declared in this scope; did you mean 'char'?
365 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~
| char
p1539.cpp:365:36: error: 'traits' was not declared in this scope
365 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~
p1539.cpp:365:44: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
365 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~~~~
| alloca
p1539.cpp:365:53: error: template argument 1 is invalid
365 | void str(const basic_string<charT, traits, Allocator>& s);
| ^
p1539.cpp:365:53: error: template argument 2 is invalid
p1539.cpp:365:53: error: template argument 3 is invalid
p1539.cpp:367:10: error: expected type-specifier before 'str'
367 | rdbuf()->str(s); template<class SAlloc>
| ^~~
p1539.cpp:367:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:368:31: error: 'charT' was not declared in this scope; did you mean 'char'?
368 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~
| char
p1539.cpp:368:38: error: 'traits' was not declared in this scope
368 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~~
p1539.cpp:368:52: error: template argument 1 is invalid
368 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^
p1539.cpp:368:52: error: template argument 2 is invalid
p1539.cpp:370:10: error: expected type-specifier before 'str'
370 | rdbuf()->str(s);
| ^~~
p1539.cpp:370:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:371:23: error: 'charT' was not declared in this scope; did you mean 'char'?
371 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~
| char
p1539.cpp:371:30: error: 'traits' was not declared in this scope
371 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~
p1539.cpp:371:38: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
371 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~~~~
| alloca
p1539.cpp:371:47: error: template argument 1 is invalid
371 | void str(basic_string<charT, traits, Allocator>&& s);
| ^
p1539.cpp:371:47: error: template argument 2 is invalid
p1539.cpp:371:47: error: template argument 3 is invalid
p1539.cpp:373:10: error: expected type-specifier before 'str'
373 | rdbuf()->str(std::move(s));
| ^~~
p1539.cpp:373:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:411:10: error: 'std::basic_ostringstream<charT, traits, Allocator>::basic_ostringstream(std::ios_base::openmode)' cannot be overloaded with 'std::basic_ostringstream<charT, traits, Allocator>::basic_ostringstream(std::ios_base::openmode)'
411 | explicit basic_ostringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:388:72: note: previous declaration 'std::basic_ostringstream<charT, traits, Allocator>::basic_ostringstream(std::ios_base::openmode)'
388 | basic_ostringstream() : basic_ostringstream(ios_base::out) {} explicit basic_ostringstream(ios_base::openmode which); explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:417:1: error: reference to 'basic_stringbuf' is ambiguous
417 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
p1539.cpp:428:1: error: reference to 'basic_stringbuf' is ambiguous
428 | basic_stringbuf<charT, traits, Allocator> sb; // exposition only
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
p1539.cpp:433:22: error: 'charT' was not declared in this scope; did you mean 'char'?
433 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~
| char
p1539.cpp:433:29: error: 'traits' was not declared in this scope
433 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~
p1539.cpp:433:37: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
433 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~~~~
| alloca
p1539.cpp:433:46: error: template argument 1 is invalid
433 | const basic_string<charT, traits, Allocator>& s,
| ^
p1539.cpp:433:46: error: template argument 2 is invalid
p1539.cpp:433:46: error: template argument 3 is invalid
p1539.cpp:432:10: error: reference to 'basic_ostringstream' is ambiguous
432 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:379:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_ostringstream'
379 | class basic_ostringstream : public basic_ostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:104:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_ostringstream'
104 | class basic_ostringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:432:10: error: ISO C++ forbids declaration of 'basic_ostringstream' with no type [-fpermissive]
432 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:432:1: error: 'explicit' outside class declaration
432 | explicit basic_ostringstream(
| ^~~~~~~~
p1539.cpp:436:53: error: 'Allocator' does not name a type; did you mean 'alloca'?
436 | basic_ostringstream(ios_base::openmode which, const Allocator& a);
| ^~~~~~~~~
| alloca
p1539.cpp:436:1: error: reference to 'basic_ostringstream' is ambiguous
436 | basic_ostringstream(ios_base::openmode which, const Allocator& a);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:379:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_ostringstream'
379 | class basic_ostringstream : public basic_ostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:104:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_ostringstream'
104 | class basic_ostringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:432:10: note: 'int basic_ostringstream(const int&, std::ios_base::openmode)'
432 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:436:66: error: expected constructor, destructor, or type conversion before ';' token
436 | basic_ostringstream(ios_base::openmode which, const Allocator& a);
| ^
p1539.cpp:439:16: error: 'charT' was not declared in this scope; did you mean 'char'?
439 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~
| char
p1539.cpp:439:23: error: 'traits' was not declared in this scope
439 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~
p1539.cpp:439:31: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
439 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~~~~
| alloca
p1539.cpp:439:40: error: template argument 1 is invalid
439 | basic_string<charT, traits, Allocator>&& s,
| ^
p1539.cpp:439:40: error: template argument 2 is invalid
p1539.cpp:439:40: error: template argument 3 is invalid
p1539.cpp:438:10: error: reference to 'basic_ostringstream' is ambiguous
438 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:379:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_ostringstream'
379 | class basic_ostringstream : public basic_ostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:104:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_ostringstream'
104 | class basic_ostringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:432:10: note: 'int basic_ostringstream(const int&, std::ios_base::openmode)'
432 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:438:10: error: ISO C++ forbids declaration of 'basic_ostringstream' with no type [-fpermissive]
438 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:438:1: error: 'explicit' outside class declaration
438 | explicit basic_ostringstream(
| ^~~~~~~~
p1539.cpp:444:20: error: 'charT' was not declared in this scope; did you mean 'char'?
444 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~
| char
p1539.cpp:444:27: error: 'traits' was not declared in this scope
444 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~~
p1539.cpp:444:41: error: template argument 1 is invalid
444 | const basic_string<charT, traits, SAlloc>& s,
| ^
p1539.cpp:444:41: error: template argument 2 is invalid
p1539.cpp:445:33: error: 'Allocator' does not name a type; did you mean 'alloca'?
445 | ios_base::openmode which, const Allocator& a);
| ^~~~~~~~~
| alloca
p1539.cpp:443:3: error: reference to 'basic_ostringstream' is ambiguous
443 | basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:379:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_ostringstream'
379 | class basic_ostringstream : public basic_ostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:104:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_ostringstream'
104 | class basic_ostringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:438:10: note: 'int basic_ostringstream(int&&, std::ios_base::openmode)'
438 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:432:10: note: 'int basic_ostringstream(const int&, std::ios_base::openmode)'
432 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:445:46: error: expected constructor, destructor, or type conversion before ';' token
445 | ios_base::openmode which, const Allocator& a);
| ^
p1539.cpp:449:24: error: 'charT' was not declared in this scope; did you mean 'char'?
449 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~
| char
p1539.cpp:449:31: error: 'traits' was not declared in this scope
449 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~~
p1539.cpp:449:45: error: template argument 1 is invalid
449 | const basic_string<charT, traits, SAlloc>& s,
| ^
p1539.cpp:449:45: error: template argument 2 is invalid
p1539.cpp:448:12: error: reference to 'basic_ostringstream' is ambiguous
448 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:379:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_ostringstream'
379 | class basic_ostringstream : public basic_ostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:104:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_ostringstream'
104 | class basic_ostringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:438:10: note: 'int basic_ostringstream(int&&, std::ios_base::openmode)'
438 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:432:10: note: 'int basic_ostringstream(const int&, std::ios_base::openmode)'
432 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:448:12: error: ISO C++ forbids declaration of 'basic_ostringstream' with no type [-fpermissive]
448 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:448:3: error: 'explicit' outside class declaration
448 | explicit basic_ostringstream(
| ^~~~~~~~
p1539.cpp:453:2: error: expected unqualified-id before numeric constant
453 | (31.8.2.2). basic_ostringstream(basic_ostringstream&& rhs);
| ^~~~~~~~
p1539.cpp:453:2: error: expected ')' before numeric constant
453 | (31.8.2.2). basic_ostringstream(basic_ostringstream&& rhs);
| ~^~~~~~~~
| )
p1539.cpp:456:6: error: variable or field 'swap' declared void
456 | void swap(basic_ostringstream& rhs);
| ^~~~
p1539.cpp:456:11: error: reference to 'basic_ostringstream' is ambiguous
456 | void swap(basic_ostringstream& rhs);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:379:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_ostringstream'
379 | class basic_ostringstream : public basic_ostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:104:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_ostringstream'
104 | class basic_ostringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:448:12: note: 'template<class SAlloc> int basic_ostringstream(const int&, std::ios_base::openmode)'
448 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:438:10: note: 'int basic_ostringstream(int&&, std::ios_base::openmode)'
438 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:432:10: note: 'int basic_ostringstream(const int&, std::ios_base::openmode)'
432 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:456:32: error: 'rhs' was not declared in this scope
456 | void swap(basic_ostringstream& rhs);
| ^~~
p1539.cpp:458:15: error: 'charT' was not declared in this scope; did you mean 'char'?
458 | basic_ostream<charT, traits>::swap(rhs);
| ^~~~~
| char
p1539.cpp:458:22: error: 'traits' was not declared in this scope
458 | basic_ostream<charT, traits>::swap(rhs);
| ^~~~~~
p1539.cpp:458:28: error: template argument 1 is invalid
458 | basic_ostream<charT, traits>::swap(rhs);
| ^
p1539.cpp:458:28: error: template argument 2 is invalid
p1539.cpp:458:31: error: redefinition of 'int swap'
458 | basic_ostream<charT, traits>::swap(rhs);
| ^~~~
p1539.cpp:345:31: note: 'int swap' previously defined here
345 | basic_istream<charT, traits>::swap(rhs);
| ^~~~
p1539.cpp:458:36: error: 'rhs' was not declared in this scope
458 | basic_ostream<charT, traits>::swap(rhs);
| ^~~
p1539.cpp:459:3: error: 'sb' does not name a type
459 | sb.swap(rhs.sb);
| ^~
p1539.cpp:461:8: error: variable or field 'swap' declared void
461 | void swap(basic_ostringstream<charT, traits, Allocator>& x,
| ^~~~
p1539.cpp:461:13: error: reference to 'basic_ostringstream' is ambiguous
461 | void swap(basic_ostringstream<charT, traits, Allocator>& x,
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:379:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_ostringstream'
379 | class basic_ostringstream : public basic_ostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:104:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_ostringstream'
104 | class basic_ostringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:448:12: note: 'template<class SAlloc> int basic_ostringstream(const int&, std::ios_base::openmode)'
448 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:438:10: note: 'int basic_ostringstream(int&&, std::ios_base::openmode)'
438 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:432:10: note: 'int basic_ostringstream(const int&, std::ios_base::openmode)'
432 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:461:38: error: expected primary-expression before ',' token
461 | void swap(basic_ostringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:461:46: error: expected primary-expression before ',' token
461 | void swap(basic_ostringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:461:57: error: expected primary-expression before '>' token
461 | void swap(basic_ostringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:461:60: error: 'x' was not declared in this scope
461 | void swap(basic_ostringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:462:13: error: reference to 'basic_ostringstream' is ambiguous
462 | basic_ostringstream<charT, traits, Allocator>& y);
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:379:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_ostringstream'
379 | class basic_ostringstream : public basic_ostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:104:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_ostringstream'
104 | class basic_ostringstream;
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:448:12: note: 'template<class SAlloc> int basic_ostringstream(const int&, std::ios_base::openmode)'
448 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:438:10: note: 'int basic_ostringstream(int&&, std::ios_base::openmode)'
438 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:432:10: note: 'int basic_ostringstream(const int&, std::ios_base::openmode)'
432 | explicit basic_ostringstream(
| ^~~~~~~~~~~~~~~~~~~
p1539.cpp:462:38: error: expected primary-expression before ',' token
462 | basic_ostringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:462:46: error: expected primary-expression before ',' token
462 | basic_ostringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:462:57: error: expected primary-expression before '>' token
462 | basic_ostringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:462:60: error: 'y' was not declared in this scope; did you mean 'yn'?
462 | basic_ostringstream<charT, traits, Allocator>& y);
| ^
| yn
p1539.cpp:465:17: error: 'charT' was not declared in this scope; did you mean 'char'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:465:24: error: 'traits' was not declared in this scope
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:465:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:465:17: error: 'charT' was not declared in this scope; did you mean 'char'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:465:24: error: 'traits' was not declared in this scope
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:465:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:465:17: error: 'charT' was not declared in this scope; did you mean 'char'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:465:24: error: 'traits' was not declared in this scope
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:465:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:465:17: error: 'charT' was not declared in this scope; did you mean 'char'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:465:24: error: 'traits' was not declared in this scope
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:465:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:465:17: error: 'charT' was not declared in this scope; did you mean 'char'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:465:24: error: 'traits' was not declared in this scope
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:465:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:465:17: error: 'charT' was not declared in this scope; did you mean 'char'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:465:24: error: 'traits' was not declared in this scope
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:465:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:465:17: error: 'charT' was not declared in this scope; did you mean 'char'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:465:24: error: 'traits' was not declared in this scope
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:465:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:465:17: error: 'charT' was not declared in this scope; did you mean 'char'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:465:24: error: 'traits' was not declared in this scope
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:465:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:465:17: error: 'charT' was not declared in this scope; did you mean 'char'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:465:24: error: 'traits' was not declared in this scope
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:465:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:465:1: error: reference to 'basic_stringbuf' is ambiguous
465 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:147:12: note: 'template<class SAlloc> int basic_stringbuf(const int&, std::ios_base::openmode)'
147 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:137:10: note: 'int basic_stringbuf(int&&, std::ios_base::openmode)'
137 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:130:10: note: 'int basic_stringbuf(const int&, std::ios_base::openmode)'
130 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:127:10: note: 'int basic_stringbuf(std::ios_base::openmode)'
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:467:1: error: expected unqualified-id before 'const_cast'
467 | const_cast<basic_stringbuf<charT, traits, Allocator>*>(addressof(sb)). basic_string<charT, traits, Allocator> str() const &;
| ^~~~~~~~~~
p1539.cpp:469:1: error: expected unqualified-id before 'return'
469 | return rdbuf()->str();
| ^~~~~~
p1539.cpp:471:16: error: 'charT' was not declared in this scope; did you mean 'char'?
471 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~
| char
p1539.cpp:471:22: error: 'traits' was not declared in this scope
471 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~~
p1539.cpp:471:35: error: template argument 1 is invalid
471 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^
p1539.cpp:471:35: error: template argument 2 is invalid
p1539.cpp:471:59: error: non-member function 'int str(const SAlloc&)' cannot have cv-qualifier
471 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~
p1539.cpp:473:1: error: expected unqualified-id before 'return'
473 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~
p1539.cpp:473:39: error: 'charT' was not declared in this scope; did you mean 'char'?
473 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~
| char
p1539.cpp:473:45: error: 'traits' was not declared in this scope
473 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~
p1539.cpp:473:52: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
473 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~~~~
| alloca
p1539.cpp:473:61: error: template argument 1 is invalid
473 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^
p1539.cpp:473:61: error: template argument 2 is invalid
p1539.cpp:473:61: error: template argument 3 is invalid
p1539.cpp:473:69: error: non-member function 'int str()' cannot have ref-qualifier
473 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~
p1539.cpp:475:1: error: expected unqualified-id before 'return'
475 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~
p1539.cpp:475:53: error: 'charT' was not declared in this scope; did you mean 'char'?
475 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~
| char
p1539.cpp:475:60: error: 'traits' was not declared in this scope
475 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~
p1539.cpp:475:66: error: template argument 1 is invalid
475 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^
p1539.cpp:475:66: error: template argument 2 is invalid
p1539.cpp:475:81: error: non-member function 'int view()' cannot have cv-qualifier
475 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~~~
p1539.cpp:477:1: error: expected unqualified-id before 'return'
477 | return rdbuf()->view();
| ^~~~~~
p1539.cpp:478:29: error: 'charT' was not declared in this scope; did you mean 'char'?
478 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~
| char
p1539.cpp:478:36: error: 'traits' was not declared in this scope
478 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~
p1539.cpp:478:44: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
478 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~~~~
| alloca
p1539.cpp:478:53: error: template argument 1 is invalid
478 | void str(const basic_string<charT, traits, Allocator>& s);
| ^
p1539.cpp:478:53: error: template argument 2 is invalid
p1539.cpp:478:53: error: template argument 3 is invalid
p1539.cpp:480:10: error: expected type-specifier before 'str'
480 | rdbuf()->str(s); template<class SAlloc>
| ^~~
p1539.cpp:480:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:481:31: error: 'charT' was not declared in this scope; did you mean 'char'?
481 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~
| char
p1539.cpp:481:38: error: 'traits' was not declared in this scope
481 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~~
p1539.cpp:481:52: error: template argument 1 is invalid
481 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^
p1539.cpp:481:52: error: template argument 2 is invalid
p1539.cpp:483:10: error: expected type-specifier before 'str'
483 | rdbuf()->str(s);
| ^~~
p1539.cpp:483:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:484:23: error: 'charT' was not declared in this scope; did you mean 'char'?
484 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~
| char
p1539.cpp:484:30: error: 'traits' was not declared in this scope
484 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~
p1539.cpp:484:38: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
484 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~~~~
| alloca
p1539.cpp:484:47: error: template argument 1 is invalid
484 | void str(basic_string<charT, traits, Allocator>&& s);
| ^
p1539.cpp:484:47: error: template argument 2 is invalid
p1539.cpp:484:47: error: template argument 3 is invalid
p1539.cpp:486:10: error: expected type-specifier before 'str'
486 | rdbuf()->str(std::move(s));
| ^~~
p1539.cpp:486:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:528:1: error: reference to 'basic_stringbuf' is ambiguous
528 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
p1539.cpp:539:1: error: reference to 'basic_stringbuf' is ambiguous
539 | basic_stringbuf<charT, traits> sb; // exposition only
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: candidates are: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
p1539.cpp:544:10: error: reference to 'basic_stringstream' is ambiguous
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:492:7: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringstream'
492 | class basic_stringstream : public basic_iostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:108:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringstream'
108 | class basic_stringstream;
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:544:10: error: ISO C++ forbids declaration of 'basic_stringstream' with no type [-fpermissive]
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:544:1: error: 'explicit' outside class declaration
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~
p1539.cpp:547:22: error: 'charT' was not declared in this scope; did you mean 'char'?
547 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~
| char
p1539.cpp:547:29: error: 'traits' was not declared in this scope
547 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~
p1539.cpp:547:37: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
547 | const basic_string<charT, traits, Allocator>& s,
| ^~~~~~~~~
| alloca
p1539.cpp:547:46: error: template argument 1 is invalid
547 | const basic_string<charT, traits, Allocator>& s,
| ^
p1539.cpp:547:46: error: template argument 2 is invalid
p1539.cpp:547:46: error: template argument 3 is invalid
p1539.cpp:546:10: error: reference to 'basic_stringstream' is ambiguous
546 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:492:7: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringstream'
492 | class basic_stringstream : public basic_iostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:108:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringstream'
108 | class basic_stringstream;
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:544:10: note: 'int basic_stringstream(std::ios_base::openmode)'
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:546:10: error: ISO C++ forbids declaration of 'basic_stringstream' with no type [-fpermissive]
546 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:546:1: error: 'explicit' outside class declaration
546 | explicit basic_stringstream(
| ^~~~~~~~
p1539.cpp:550:52: error: 'Allocator' does not name a type; did you mean 'alloca'?
550 | basic_stringstream(ios_base::openmode which, const Allocator& a);
| ^~~~~~~~~
| alloca
p1539.cpp:550:1: error: reference to 'basic_stringstream' is ambiguous
550 | basic_stringstream(ios_base::openmode which, const Allocator& a);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:492:7: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringstream'
492 | class basic_stringstream : public basic_iostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:108:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringstream'
108 | class basic_stringstream;
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:546:10: note: 'int basic_stringstream(const int&, std::ios_base::openmode)'
546 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:544:10: note: 'int basic_stringstream(std::ios_base::openmode)'
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:550:65: error: expected constructor, destructor, or type conversion before ';' token
550 | basic_stringstream(ios_base::openmode which, const Allocator& a);
| ^
p1539.cpp:553:16: error: 'charT' was not declared in this scope; did you mean 'char'?
553 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~
| char
p1539.cpp:553:23: error: 'traits' was not declared in this scope
553 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~
p1539.cpp:553:31: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
553 | basic_string<charT, traits, Allocator>&& s,
| ^~~~~~~~~
| alloca
p1539.cpp:553:40: error: template argument 1 is invalid
553 | basic_string<charT, traits, Allocator>&& s,
| ^
p1539.cpp:553:40: error: template argument 2 is invalid
p1539.cpp:553:40: error: template argument 3 is invalid
p1539.cpp:552:10: error: reference to 'basic_stringstream' is ambiguous
552 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:492:7: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringstream'
492 | class basic_stringstream : public basic_iostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:108:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringstream'
108 | class basic_stringstream;
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:546:10: note: 'int basic_stringstream(const int&, std::ios_base::openmode)'
546 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:544:10: note: 'int basic_stringstream(std::ios_base::openmode)'
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:552:10: error: ISO C++ forbids declaration of 'basic_stringstream' with no type [-fpermissive]
552 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:552:1: error: 'explicit' outside class declaration
552 | explicit basic_stringstream(
| ^~~~~~~~
p1539.cpp:558:20: error: 'charT' was not declared in this scope; did you mean 'char'?
558 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~
| char
p1539.cpp:558:27: error: 'traits' was not declared in this scope
558 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~~
p1539.cpp:558:41: error: template argument 1 is invalid
558 | const basic_string<charT, traits, SAlloc>& s,
| ^
p1539.cpp:558:41: error: template argument 2 is invalid
p1539.cpp:559:33: error: 'Allocator' does not name a type; did you mean 'alloca'?
559 | ios_base::openmode which, const Allocator& a);
| ^~~~~~~~~
| alloca
p1539.cpp:557:3: error: reference to 'basic_stringstream' is ambiguous
557 | basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:492:7: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringstream'
492 | class basic_stringstream : public basic_iostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:108:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringstream'
108 | class basic_stringstream;
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:552:10: note: 'int basic_stringstream(int&&, std::ios_base::openmode)'
552 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:546:10: note: 'int basic_stringstream(const int&, std::ios_base::openmode)'
546 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:544:10: note: 'int basic_stringstream(std::ios_base::openmode)'
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:559:46: error: expected constructor, destructor, or type conversion before ';' token
559 | ios_base::openmode which, const Allocator& a);
| ^
p1539.cpp:563:20: error: 'charT' was not declared in this scope; did you mean 'char'?
563 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~
| char
p1539.cpp:563:27: error: 'traits' was not declared in this scope
563 | const basic_string<charT, traits, SAlloc>& s,
| ^~~~~~
p1539.cpp:563:41: error: template argument 1 is invalid
563 | const basic_string<charT, traits, SAlloc>& s,
| ^
p1539.cpp:563:41: error: template argument 2 is invalid
p1539.cpp:562:12: error: reference to 'basic_stringstream' is ambiguous
562 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:492:7: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringstream'
492 | class basic_stringstream : public basic_iostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:108:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringstream'
108 | class basic_stringstream;
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:552:10: note: 'int basic_stringstream(int&&, std::ios_base::openmode)'
552 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:546:10: note: 'int basic_stringstream(const int&, std::ios_base::openmode)'
546 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:544:10: note: 'int basic_stringstream(std::ios_base::openmode)'
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:562:12: error: ISO C++ forbids declaration of 'basic_stringstream' with no type [-fpermissive]
562 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:562:3: error: 'explicit' outside class declaration
562 | explicit basic_stringstream(
| ^~~~~~~~
p1539.cpp:567:19: error: expected constructor, destructor, or type conversion before '(' token
567 | basic_stringstream(basic_stringstream&& rhs);
| ^
p1539.cpp:570:6: error: variable or field 'swap' declared void
570 | void swap(basic_stringstream& rhs);
| ^~~~
p1539.cpp:570:11: error: reference to 'basic_stringstream' is ambiguous
570 | void swap(basic_stringstream& rhs);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:492:7: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringstream'
492 | class basic_stringstream : public basic_iostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:108:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringstream'
108 | class basic_stringstream;
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:562:12: note: 'template<class SAlloc> int basic_stringstream(const int&, std::ios_base::openmode)'
562 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:552:10: note: 'int basic_stringstream(int&&, std::ios_base::openmode)'
552 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:546:10: note: 'int basic_stringstream(const int&, std::ios_base::openmode)'
546 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:544:10: note: 'int basic_stringstream(std::ios_base::openmode)'
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:570:31: error: 'rhs' was not declared in this scope
570 | void swap(basic_stringstream& rhs);
| ^~~
p1539.cpp:572:16: error: 'charT' was not declared in this scope; did you mean 'char'?
572 | basic_iostream<charT,traits>::swap(rhs);
| ^~~~~
| char
p1539.cpp:572:22: error: 'traits' was not declared in this scope
572 | basic_iostream<charT,traits>::swap(rhs);
| ^~~~~~
p1539.cpp:572:28: error: template argument 1 is invalid
572 | basic_iostream<charT,traits>::swap(rhs);
| ^
p1539.cpp:572:28: error: template argument 2 is invalid
p1539.cpp:572:31: error: redefinition of 'int swap'
572 | basic_iostream<charT,traits>::swap(rhs);
| ^~~~
p1539.cpp:345:31: note: 'int swap' previously defined here
345 | basic_istream<charT, traits>::swap(rhs);
| ^~~~
p1539.cpp:572:36: error: 'rhs' was not declared in this scope
572 | basic_iostream<charT,traits>::swap(rhs);
| ^~~
p1539.cpp:573:3: error: 'sb' does not name a type
573 | sb.swap(rhs.sb);
| ^~
p1539.cpp:575:8: error: variable or field 'swap' declared void
575 | void swap(basic_stringstream<charT, traits, Allocator>& x,
| ^~~~
p1539.cpp:575:13: error: reference to 'basic_stringstream' is ambiguous
575 | void swap(basic_stringstream<charT, traits, Allocator>& x,
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:492:7: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringstream'
492 | class basic_stringstream : public basic_iostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:108:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringstream'
108 | class basic_stringstream;
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:562:12: note: 'template<class SAlloc> int basic_stringstream(const int&, std::ios_base::openmode)'
562 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:552:10: note: 'int basic_stringstream(int&&, std::ios_base::openmode)'
552 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:546:10: note: 'int basic_stringstream(const int&, std::ios_base::openmode)'
546 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:544:10: note: 'int basic_stringstream(std::ios_base::openmode)'
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:575:37: error: expected primary-expression before ',' token
575 | void swap(basic_stringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:575:45: error: expected primary-expression before ',' token
575 | void swap(basic_stringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:575:56: error: expected primary-expression before '>' token
575 | void swap(basic_stringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:575:59: error: 'x' was not declared in this scope
575 | void swap(basic_stringstream<charT, traits, Allocator>& x,
| ^
p1539.cpp:576:13: error: reference to 'basic_stringstream' is ambiguous
576 | basic_stringstream<charT, traits, Allocator>& y);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:492:7: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringstream'
492 | class basic_stringstream : public basic_iostream<charT, traits> {
| ^~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:108:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringstream'
108 | class basic_stringstream;
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:562:12: note: 'template<class SAlloc> int basic_stringstream(const int&, std::ios_base::openmode)'
562 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:552:10: note: 'int basic_stringstream(int&&, std::ios_base::openmode)'
552 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:546:10: note: 'int basic_stringstream(const int&, std::ios_base::openmode)'
546 | explicit basic_stringstream(
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:544:10: note: 'int basic_stringstream(std::ios_base::openmode)'
544 | explicit basic_stringstream(ios_base::openmode which);
| ^~~~~~~~~~~~~~~~~~
p1539.cpp:576:37: error: expected primary-expression before ',' token
576 | basic_stringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:576:45: error: expected primary-expression before ',' token
576 | basic_stringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:576:56: error: expected primary-expression before '>' token
576 | basic_stringstream<charT, traits, Allocator>& y);
| ^
p1539.cpp:576:59: error: 'y' was not declared in this scope; did you mean 'yn'?
576 | basic_stringstream<charT, traits, Allocator>& y);
| ^
| yn
p1539.cpp:579:17: error: 'charT' was not declared in this scope; did you mean 'char'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:579:24: error: 'traits' was not declared in this scope
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:579:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:579:17: error: 'charT' was not declared in this scope; did you mean 'char'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:579:24: error: 'traits' was not declared in this scope
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:579:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:579:17: error: 'charT' was not declared in this scope; did you mean 'char'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:579:24: error: 'traits' was not declared in this scope
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:579:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:579:17: error: 'charT' was not declared in this scope; did you mean 'char'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:579:24: error: 'traits' was not declared in this scope
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:579:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:579:17: error: 'charT' was not declared in this scope; did you mean 'char'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:579:24: error: 'traits' was not declared in this scope
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:579:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:579:17: error: 'charT' was not declared in this scope; did you mean 'char'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:579:24: error: 'traits' was not declared in this scope
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:579:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:579:17: error: 'charT' was not declared in this scope; did you mean 'char'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:579:24: error: 'traits' was not declared in this scope
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:579:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:579:17: error: 'charT' was not declared in this scope; did you mean 'char'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:579:24: error: 'traits' was not declared in this scope
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:579:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:579:17: error: 'charT' was not declared in this scope; did you mean 'char'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~
| char
p1539.cpp:579:24: error: 'traits' was not declared in this scope
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~
p1539.cpp:579:32: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~
| alloca
p1539.cpp:579:1: error: reference to 'basic_stringbuf' is ambiguous
579 | basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
| ^~~~~~~~~~~~~~~
p1539.cpp:56:11: note: candidates are: 'template<class charT, class traits, class Allocator> class std::basic_stringbuf'
56 | class basic_stringbuf : public basic_streambuf<charT, traits> {
| ^~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:96:11: note: 'template<class _CharT, class _Traits, class _Alloc> class std::__cxx11::basic_stringbuf'
96 | class basic_stringbuf;
| ^~~~~~~~~~~~~~~
p1539.cpp:147:12: note: 'template<class SAlloc> int basic_stringbuf(const int&, std::ios_base::openmode)'
147 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:137:10: note: 'int basic_stringbuf(int&&, std::ios_base::openmode)'
137 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:130:10: note: 'int basic_stringbuf(const int&, std::ios_base::openmode)'
130 | explicit basic_stringbuf(
| ^~~~~~~~~~~~~~~
p1539.cpp:127:10: note: 'int basic_stringbuf(std::ios_base::openmode)'
127 | explicit basic_stringbuf(ios_base::openmode which);
| ^~~~~~~~~~~~~~~
p1539.cpp:581:14: error: 'charT' was not declared in this scope; did you mean 'char'?
581 | basic_string<charT, traits, Allocator> str() const &;
| ^~~~~
| char
p1539.cpp:581:21: error: 'traits' was not declared in this scope
581 | basic_string<charT, traits, Allocator> str() const &;
| ^~~~~~
p1539.cpp:581:29: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
581 | basic_string<charT, traits, Allocator> str() const &;
| ^~~~~~~~~
| alloca
p1539.cpp:581:38: error: template argument 1 is invalid
581 | basic_string<charT, traits, Allocator> str() const &;
| ^
p1539.cpp:581:38: error: template argument 2 is invalid
p1539.cpp:581:38: error: template argument 3 is invalid
p1539.cpp:581:52: error: non-member function 'int str()' cannot have cv-qualifier
581 | basic_string<charT, traits, Allocator> str() const &;
| ^
p1539.cpp:581:52: error: non-member function 'int str()' cannot have ref-qualifier
p1539.cpp:583:16: error: 'charT' was not declared in this scope; did you mean 'char'?
583 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~
| char
p1539.cpp:583:22: error: 'traits' was not declared in this scope
583 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~~
p1539.cpp:583:29: error: 'SAlloc' was not declared in this scope; did you mean 'valloc'?
583 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~~
| valloc
p1539.cpp:583:35: error: template argument 1 is invalid
583 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^
p1539.cpp:583:35: error: template argument 2 is invalid
p1539.cpp:583:35: error: template argument 3 is invalid
p1539.cpp:583:47: error: 'SAlloc' does not name a type
583 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~~
p1539.cpp:583:59: error: non-member function 'int str(const int&)' cannot have cv-qualifier
583 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~~~
p1539.cpp:583:37: error: ambiguating new declaration of 'int str(const int&)'
583 | basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
| ^~~
p1539.cpp:478:6: note: old declaration 'void str(const int&)'
478 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~
p1539.cpp:585:1: error: expected unqualified-id before 'return'
585 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~
p1539.cpp:585:39: error: 'charT' was not declared in this scope; did you mean 'char'?
585 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~
| char
p1539.cpp:585:45: error: 'traits' was not declared in this scope
585 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~
p1539.cpp:585:52: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
585 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~~~~~~~~
| alloca
p1539.cpp:585:61: error: template argument 1 is invalid
585 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^
p1539.cpp:585:61: error: template argument 2 is invalid
p1539.cpp:585:61: error: template argument 3 is invalid
p1539.cpp:585:69: error: non-member function 'int str()' cannot have ref-qualifier
585 | return rdbuf()->str(sa); basic_string<charT,traits,Allocator> str() &&;
| ^~
p1539.cpp:587:1: error: expected unqualified-id before 'return'
587 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~
p1539.cpp:587:53: error: 'charT' was not declared in this scope; did you mean 'char'?
587 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~
| char
p1539.cpp:587:60: error: 'traits' was not declared in this scope
587 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~
p1539.cpp:587:66: error: template argument 1 is invalid
587 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^
p1539.cpp:587:66: error: template argument 2 is invalid
p1539.cpp:587:81: error: non-member function 'int view()' cannot have cv-qualifier
587 | return std::move(*rdbuf()).str(); basic_string_view<charT, traits> view() const noexcept;
| ^~~~~~~~
p1539.cpp:589:1: error: expected unqualified-id before 'return'
589 | return rdbuf()->view();
| ^~~~~~
p1539.cpp:590:29: error: 'charT' was not declared in this scope; did you mean 'char'?
590 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~
| char
p1539.cpp:590:36: error: 'traits' was not declared in this scope
590 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~
p1539.cpp:590:44: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
590 | void str(const basic_string<charT, traits, Allocator>& s);
| ^~~~~~~~~
| alloca
p1539.cpp:590:53: error: template argument 1 is invalid
590 | void str(const basic_string<charT, traits, Allocator>& s);
| ^
p1539.cpp:590:53: error: template argument 2 is invalid
p1539.cpp:590:53: error: template argument 3 is invalid
p1539.cpp:592:10: error: expected type-specifier before 'str'
592 | rdbuf()->str(s);
| ^~~
p1539.cpp:592:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:594:31: error: 'charT' was not declared in this scope; did you mean 'char'?
594 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~
| char
p1539.cpp:594:38: error: 'traits' was not declared in this scope
594 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^~~~~~
p1539.cpp:594:52: error: template argument 1 is invalid
594 | void str(const basic_string<charT, traits, SAlloc>& s);
| ^
p1539.cpp:594:52: error: template argument 2 is invalid
p1539.cpp:596:10: error: expected type-specifier before 'str'
596 | rdbuf()->str(s);
| ^~~
p1539.cpp:596:10: error: expected constructor, destructor, or type conversion before 'str'
p1539.cpp:597:23: error: 'charT' was not declared in this scope; did you mean 'char'?
597 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~
| char
p1539.cpp:597:30: error: 'traits' was not declared in this scope
597 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~
p1539.cpp:597:38: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
597 | void str(basic_string<charT, traits, Allocator>&& s);
| ^~~~~~~~~
| alloca
p1539.cpp:597:47: error: template argument 1 is invalid
597 | void str(basic_string<charT, traits, Allocator>&& s);
| ^
p1539.cpp:597:47: error: template argument 2 is invalid
p1539.cpp:597:47: error: template argument 3 is invalid
p1539.cpp:599:10: error: expected type-specifier before 'str'
599 | rdbuf()->str(std::move(s));
| ^~~
p1539.cpp:599:10: error: expected constructor, destructor, or type conversion before 'str'
検討事項(agenda)
コンパイルエラーを取るか、コンパイルエラーの理由を解説する。
応用例1 AUTOSAR C++
AUTOSARでC++のコーディング標準を作っている。
MISRA-C++コーディング標準の改訂をまたずに、C++14に対応したかったためかもしれない。
Autosar Guidelines C++14 example code compile list
MISRA C++, AUTOSAR C++について
応用例2 MISRA C/C++
MISRA C まとめ #include
MISRA C++ 5-0-16
応用例3 CERT C/C++
SEI CERT C++ Coding Standard AA. Bibliography 確認中。
MISRA C/C++, AUTOSAR C++, CERT C/C++とC/C++工業標準をコンパイルする
応用例4 箱庭
箱庭もくもく会 #10 日時:2022/09/14(水) 17:30-19:30
箱庭ではUnityをはじめC++を使っているらしい。
ここでコンパイルしたコードと同じようなコードを使っているか、
ここで出たコンパイルエラーと同じようなエラーがでたかを
いろいろな版のコンパイラでコンパイルして確認していく。
この項目は、箱庭プロジェクトを市場分析の対象として、原則的には、箱庭プロジェクトの外部から分析し、外部から箱庭の広告宣伝のための戦略会議を仮想した結果、仮想「箱庭もくもく会」を開催してみることを企画するものである。
一切の内容は、箱庭プロジェクト、Athrill, TOPPERSとは無関係である。
一(いち)参加データアナリストの、個人的なつぶやきです。
仮想戦略会議「箱庭」
お盆には「箱庭」記事を書きましょう「もくもく会」の題材になる(1)
お盆には「箱庭」記事を書きましょう「もくもく会」の題材になる(2)
エンジニア夏休み企画
個人開発と読書感想文に焦点を当てたのは良い企画だと思った。
個人開発
【個人開発】 効率的な背景 <エンジニア夏休み企画>
Cコンパイラの試験を一人でもくもくとやっているのは個人開発の一つの姿です。
読書感想文
CコンパイラによるC言語規格の読書感想文として掲載しています。
コンパイル実験が、C++N4910に対する、G++とClang++による感想文だということご理解いただけると幸いです。
読書感想文は人間かAIだけが作るものとは限りません。
本(電子書籍を含む)を入力として、その内容に対する文字列を読書感想文として受け止めましょう。
元の文章をあり方、コンパイルできるように電子化しておくこと、コンパイラが解釈可能な断片の作り方など。
自己参考資料(self reference)
関連する自己参照以外は、こちらの先頭に移転。
C言語(C++)に対する誤解、曲解、無理解、爽快。
#include "N4910.h"
C++N4910資料の改善点
dockerにclang
docker gnu(gcc/g++) and llvm(clang/clang++)
コンパイル用shell script C版(clangとgcc)とC++版(clang++とg++)
C++N4910:2022 tag follower 300人超えました。ありがとうございます。
astyle 使ってみた
<この記事は個人の過去の経験に基づく個人の感想です。現在所属する組織、業務とは関係がありません。>
文書履歴(document history)
ver. 0.01 初稿 20220825