6.3 One-definition rule [basic.def.odr] C++N4910:2022 (6) p33.cpp 

# はじめに(Introduction)

N4910  Working Draft, Standard for Programming Language C++

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/n4910.pdf

n4910は、ISO/IEC JTC1 SC22 WG21の作業原案(Working Draft)です。
公式のISO/IEC 14882原本ではありません。
ISO/IEC JTC1 SC22 WG21では、可能な限り作業文書を公開し、幅広い意見を求めています。
一連の記事はコード断片をコンパイルできる形にする方法を検討してコンパイル、リンク、実行して、規格案の原文と処理系(g++, Clang++)との違いを確認し、技術内容を検討し、ISO/IEC JTC1 SC22 WG21にフィードバックするために用います。
また、CERT C++, MISRA C++等のコーディング標準のコード断片をコンパイルする際の参考にさせていただこうと考えています。CERT C++, MISRA C++が標準化の動きとの時間的なずれがあれば確認できれば幸いです。また、boostライブラリとの関連、Linux OS, TOPPERSカーネル、g++(GCC), clang++(LLVM）との関係も調査中です。
何か、抜け漏れ、耳より情報がありましたらおしらせくださると幸いです。

最新規格はC++N4950

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf

## 背景(back ground)
C/C++でコンパイルエラーが出ると、途方にくれることがしばしばあります。
何回かに１回は、該当するエラーが検索できます。
ただ、条件が違っていて、そこでの修正方法では目的を達成しないこともしばしばです。いろいろな条件のコンパイルエラーとその対応方法について、広く記録することによって、いつか同じエラーに遭遇した時にやくに立つことを目指しています。

この半年の間で、三度、自分のネットでの記録に助けられたことがあります。
また過去に解決できなかった記録を１０種類以上、最近になって解決できたことがあります。それは、主に次の３つの情報に基づいています。

https://stackoverflow.com
https://cpprefjp.github.io
http://ja.cppreference.com/

また
https://researchmap.jp/joub9b3my-1797580/#_1797580
に記載したサイトのお世話になっています。


## 作業方針(sequence)
Clang++では-std=c++03, C++2bの2種類
g++では-std=c++03, c++2bの２種類
でコンパイルし、

１）コンパイルエラーを収集する。
２）コンパイルエラーをなくす方法を検討する。
コンパイルエラーになる例を示すだけが目的のコードは、コンパイルエラーをなくすのではなく、コンパイルエラーの種類を収集するだけにする。
文法を示すのが目的のコード場合に、コンパイルエラーをなくすのに手間がかかる場合は、順次作業します。
３）リンクエラーをなくす方法を検討する。
文法を示すのが目的のコード場合に、リンクエラーをなくすのに手間がかかる場合は、順次作業します。
４）意味のある出力を作る。
コンパイル、リンクが通っても、意味のある出力を示そうとすると、コンパイル・リンクエラーが出て収拾できそうにない場合がある。順次作業します。

１）だけのものから４）まで進んだものと色々ある状態です。一歩でも前に進むご助言をお待ちしています。「検討事項」の欄に現状を記録するようにしています。


### C++N4910:2022 Standard Working Draft on ISO/IEC 14882(0) sample code compile list  

https://qiita.com/kaizen_nagoya/items/fc957ddddd402004bb91

## C++N4741, 2018 Standard Working Draft on ISO/IEC 14882 sample code compile list
https://qiita.com/kaizen_nagoya/items/3294c014044550896010

### 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++
https://qiita.com/kaizen_nagoya/items/685b5c1a2c17c1bf1318

## 編纂器(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.

# 6.3 One-definition rule [basic.def.odr] C++N4910:2022 (6) p33.cpp 

C++N4741,2018 (6)6.2 One-definition rule [basic.def.odr]p26

https://qiita.com/kaizen_nagoya/items/afe57f2b4804c4a7049e


C++N3242, 2011(9) 3 Basic concepts 3.2 One definition rule 

https://researchmap.jp/jorepfv9x-1797580/#_1797580

##算譜(source code)

```c++:p33.cpp
// C++N4910 Committee Draft, Standard for Programming Language C++
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/n4910.pdf
const char * msg="6.2 One-definition rule [basic.def.odr] C++N4910 (6) p33.cpp";
// Edited by Dr. Ogawa Kiyoshi. Compile procedure and results record.

#include <iostream>
#include <cstdlib>
#include <cstring>

using namespace std;
// Example 1
struct S {
  static const int x = 0;
};
const int &f(const int &r);
int n = b ? (1, S::x) // S::x is not odr-used here
        : f(S::x); // S::x is odr-used here, so a definition is required
// Example 2
void f(int n) {
  [] { n = 1; }; // error, n is not odr-usable due to intervening lambda-expression
  struct A {
    void f() {
      n = 2;  // error, n is not odr-usable due to intervening function definition scope
    }
  };
  void g(int = n); // error, n is not odr-usable due to intervening function parameter scope
  [=](int k = n) {}; // error: n is not odr-usable due to being 2022
  		     // outside the block scoper of th lambda-expression 2022
  [&] { [n]{ return n; }; }; // OK
}
// Example 3, 2022 from
auto i() {      m
	struct A {}:
	return A{};
}
decltype(i()) j();
auto x = j();    // 2022 to
// Example 4
void h() {
  struct X; // declare X as a struct type
  struct X* x1; // use X in pointer formation
  X* x2; // use X in pointer formation
  std::cout << "x1= " <<x1 <<" x2= " << x2 << std::endl;

}
// translation unit 2: Example 5
struct X {
  X(int, int);
  X(int, int, int);
};
X::X(int, int = 0, int = 0) { }
class D {
  X x = 0;
};
D d2; // X(int, int, int) called by D();
// D()’s implicit definition violates the ODR

//Excample 6
inline void k(bool cond, void (*p)() {
	if (cond) k(false, []{});
	}
inline void l(bool cond, void (*p)() = []{}){
	if (cond) l(false);
	}
struct Y {
	void m(bool cond, void(*p)() = []{}){
	if (cond) m(false);
	}
};
int main() {
  f();
  g();
  i();
  h();
  k();
  std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
  cout<< msg << endl;
  return EXIT_SUCCESS;
}
```

## 編纂・実行結果(compile and go)


```shell_session:clgc.sh
# ./clgc.sh p33
rm: cannot remove 'p33l': No such file or directory
rm: cannot remove 'p33g': No such file or directory
$ clang++ p33.cpp -std=03 -o p33l -I. -Wall
p33.cpp:16:14: warning: left operand of comma operator has no effect [-Wunused-value]
int n = b ? (1, S::x) // S::x is not odr-used here
             ^
p33.cpp:16:9: error: use of undeclared identifier 'b'
int n = b ? (1, S::x) // S::x is not odr-used here
        ^
p33.cpp:20:3: error: expected expression
  [] { n = 1; }; // error, n is not odr-usable due to intervening lambda-expression
  ^
p33.cpp:23:7: error: reference to local variable 'n' declared in enclosing function 'f'
      n = 2;  // error, n is not odr-usable due to intervening function definition scope
      ^
p33.cpp:19:12: note: 'n' declared here
void f(int n) {
           ^
p33.cpp:26:16: error: default argument references parameter 'n'
  void g(int = n); // error, n is not odr-usable due to intervening function parameter scope
               ^
p33.cpp:27:3: error: expected expression
  [=](int k = n) {}; // error: n is not odr-usable due to being 2022
  ^
p33.cpp:29:3: error: expected expression
  [&] { [n]{ return n; }; }; // OK
  ^
p33.cpp:32:1: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
auto i() {      m
^
p33.cpp:32:1: error: 'auto' not allowed in function return type
auto i() {      m
^~~~
p33.cpp:32:17: error: unknown type name 'm'
auto i() {      m
                ^
p33.cpp:33:13: error: expected ';' after struct
        struct A {}:
                   ^
                   ;
p33.cpp:34:10: error: expected '(' for function-style cast or type construction
        return A{};
               ~^
p33.cpp:36:1: error: unknown type name 'decltype'
decltype(i()) j();
^
p33.cpp:36:15: error: expected function body after function declarator
decltype(i()) j();
              ^
p33.cpp:37:1: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
auto x = j();    // 2022 to
^
p33.cpp:37:10: error: use of undeclared identifier 'j'
auto x = j();    // 2022 to
         ^
p33.cpp:53:7: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
  X x = 0;
      ^
p33.cpp:59:38: error: expected ')'
inline void k(bool cond, void (*p)() {
                                     ^
p33.cpp:59:14: note: to match this '('
inline void k(bool cond, void (*p)() {
             ^
p33.cpp:71:3: error: no matching function for call to 'f'
  f();
  ^
p33.cpp:19:6: note: candidate function not viable: requires single argument 'n', but no arguments were provided
void f(int n) {
     ^
p33.cpp:15:12: note: candidate function not viable: requires single argument 'r', but no arguments were provided
const int &f(const int &r);
           ^
p33.cpp:72:3: error: use of undeclared identifier 'g'
  g();
  ^
p33.cpp:75:3: error: no matching function for call to 'k'
  k();
  ^
p33.cpp:59:13: note: candidate function not viable: requires 2 arguments, but 0 were provided
inline void k(bool cond, void (*p)() {
            ^
p33.cpp:76:29: error: 'x' is a private member of 'D'
  std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
                            ^
p33.cpp:53:5: note: implicitly declared private here
  X x = 0;
    ^
p33.cpp:76:24: error: invalid operands to binary expression ('basic_ostream<char, std::char_traits<char> >' and 'X')
  std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
  ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:511:5: note: candidate function template not viable: no known conversion from 'X' to 'char' for 2nd argument
    operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:517:5: note: candidate function template not viable: no known conversion from 'X' to 'char' for 2nd argument
    operator<<(basic_ostream<char, _Traits>& __out, char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:523:5: note: candidate function template not viable: no known conversion from 'X' to 'signed char' for 2nd argument
    operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:528:5: note: candidate function template not viable: no known conversion from 'X' to 'unsigned char' for 2nd argument
    operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:606:5: note: candidate function template not viable: no known conversion from 'X' to 'const char *' for 2nd argument
    operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:619:5: note: candidate function template not viable: no known conversion from 'X' to 'const signed char *' for 2nd argument
    operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:624:5: note: candidate function template not viable: no known conversion from 'X' to 'const unsigned char *' for 2nd argument
    operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/ostream.tcc:321:5: note: candidate function template not viable: no known conversion from 'X' to 'const char *' for 2nd argument
    operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:506:5: note: candidate template ignored: deduced conflicting types for parameter '_CharT' ('char' vs. 'X')
    operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/basic_string.h:6468:5: note: candidate template ignored: could not match 'basic_string<_CharT, _Traits, _Alloc>' against 'X'
    operator<<(basic_ostream<_CharT, _Traits>& __os,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:589:5: note: candidate template ignored: could not match 'const _CharT *' against 'X'
    operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:108:7: note: candidate function not viable: no known conversion from 'X' to 'std::basic_ostream<char>::__ostream_type &(*)(std::basic_ostream<char>::__ostream_type &)' (aka 'basic_ostream<char, std::char_traits<char> > &(*)(basic_ostream<char, std::char_traits<char> > &)') for 1st argument
      operator<<(__ostream_type& (*__pf)(__ostream_type&))
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:117:7: note: candidate function not viable: no known conversion from 'X' to 'std::basic_ostream<char>::__ios_type &(*)(std::basic_ostream<char>::__ios_type &)' (aka 'basic_ios<char, std::char_traits<char> > &(*)(basic_ios<char, std::char_traits<char> > &)') for 1st argument
      operator<<(__ios_type& (*__pf)(__ios_type&))
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:127:7: note: candidate function not viable: no known conversion from 'X' to 'std::ios_base &(*)(std::ios_base &)' for 1st argument
      operator<<(ios_base& (*__pf) (ios_base&))
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:166:7: note: candidate function not viable: no known conversion from 'X' to 'long' for 1st argument
      operator<<(long __n)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:170:7: note: candidate function not viable: no known conversion from 'X' to 'unsigned long' for 1st argument
      operator<<(unsigned long __n)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:174:7: note: candidate function not viable: no known conversion from 'X' to 'bool' for 1st argument
      operator<<(bool __n)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:178:7: note: candidate function not viable: no known conversion from 'X' to 'short' for 1st argument
      operator<<(short __n);
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:181:7: note: candidate function not viable: no known conversion from 'X' to 'unsigned short' for 1st argument
      operator<<(unsigned short __n)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:189:7: note: candidate function not viable: no known conversion from 'X' to 'int' for 1st argument
      operator<<(int __n);
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:192:7: note: candidate function not viable: no known conversion from 'X' to 'unsigned int' for 1st argument
      operator<<(unsigned int __n)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:201:7: note: candidate function not viable: no known conversion from 'X' to 'long long' for 1st argument
      operator<<(long long __n)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:205:7: note: candidate function not viable: no known conversion from 'X' to 'unsigned long long' for 1st argument
      operator<<(unsigned long long __n)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:220:7: note: candidate function not viable: no known conversion from 'X' to 'double' for 1st argument
      operator<<(double __f)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:224:7: note: candidate function not viable: no known conversion from 'X' to 'float' for 1st argument
      operator<<(float __f)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:232:7: note: candidate function not viable: no known conversion from 'X' to 'long double' for 1st argument
      operator<<(long double __f)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:245:7: note: candidate function not viable: no known conversion from 'X' to 'const void *' for 1st argument; take the address of the argument with &
      operator<<(const void* __p)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:276:7: note: candidate function not viable: no known conversion from 'X' to 'std::basic_ostream<char>::__streambuf_type *' (aka 'basic_streambuf<char, std::char_traits<char> > *') for 1st argument
      operator<<(__streambuf_type* __sb);
      ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
4 warnings and 20 errors generated.
rm: cannot remove 'p33l': No such file or directory
$ clang++ p33.cpp -std=2b -o p33l -I. -Wall
p33.cpp:16:14: warning: left operand of comma operator has no effect [-Wunused-value]
int n = b ? (1, S::x) // S::x is not odr-used here
             ^
p33.cpp:16:9: error: use of undeclared identifier 'b'
int n = b ? (1, S::x) // S::x is not odr-used here
        ^
p33.cpp:20:8: error: variable 'n' cannot be implicitly captured in a lambda with no capture-default specified
  [] { n = 1; }; // error, n is not odr-usable due to intervening lambda-expression
       ^
p33.cpp:19:12: note: 'n' declared here
void f(int n) {
           ^
p33.cpp:20:3: note: lambda expression begins here
  [] { n = 1; }; // error, n is not odr-usable due to intervening lambda-expression
  ^
p33.cpp:20:4: note: capture 'n' by value
  [] { n = 1; }; // error, n is not odr-usable due to intervening lambda-expression
   ^
   n
p33.cpp:20:4: note: capture 'n' by reference
  [] { n = 1; }; // error, n is not odr-usable due to intervening lambda-expression
   ^
   &n
p33.cpp:20:4: note: default capture by value
  [] { n = 1; }; // error, n is not odr-usable due to intervening lambda-expression
   ^
   =
p33.cpp:20:4: note: default capture by reference
  [] { n = 1; }; // error, n is not odr-usable due to intervening lambda-expression
   ^
   &
p33.cpp:23:7: error: reference to local variable 'n' declared in enclosing function 'f'
      n = 2;  // error, n is not odr-usable due to intervening function definition scope
      ^
p33.cpp:19:12: note: 'n' declared here
void f(int n) {
           ^
p33.cpp:26:16: error: default argument references parameter 'n'
  void g(int = n); // error, n is not odr-usable due to intervening function parameter scope
               ^
p33.cpp:27:15: error: default argument references parameter 'n'
  [=](int k = n) {}; // error: n is not odr-usable due to being 2022
              ^
p33.cpp:29:9: warning: expression result unused [-Wunused-value]
  [&] { [n]{ return n; }; }; // OK
        ^~~~~~~~~~~~~~~~
p33.cpp:20:3: warning: expression result unused [-Wunused-value]
  [] { n = 1; }; // error, n is not odr-usable due to intervening lambda-expression
  ^~~~~~~~~~~~~
p33.cpp:27:3: warning: expression result unused [-Wunused-value]
  [=](int k = n) {}; // error: n is not odr-usable due to being 2022
  ^~~~~~~~~~~~~~~~~
p33.cpp:29:3: warning: expression result unused [-Wunused-value]
  [&] { [n]{ return n; }; }; // OK
  ^~~~~~~~~~~~~~~~~~~~~~~~~
p33.cpp:32:17: error: unknown type name 'm'
auto i() {      m
                ^
p33.cpp:33:13: error: expected ';' after struct
        struct A {}:
                   ^
                   ;
p33.cpp:59:38: error: expected ')'
inline void k(bool cond, void (*p)() {
                                     ^
p33.cpp:59:14: note: to match this '('
inline void k(bool cond, void (*p)() {
             ^
p33.cpp:71:3: error: no matching function for call to 'f'
  f();
  ^
p33.cpp:19:6: note: candidate function not viable: requires single argument 'n', but no arguments were provided
void f(int n) {
     ^
p33.cpp:15:12: note: candidate function not viable: requires single argument 'r', but no arguments were provided
const int &f(const int &r);
           ^
p33.cpp:72:3: error: use of undeclared identifier 'g'
  g();
  ^
p33.cpp:75:3: error: no matching function for call to 'k'
  k();
  ^
p33.cpp:59:13: note: candidate function not viable: requires 2 arguments, but 0 were provided
inline void k(bool cond, void (*p)() {
            ^
p33.cpp:76:29: error: 'x' is a private member of 'D'
  std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
                            ^
p33.cpp:53:5: note: implicitly declared private here
  X x = 0;
    ^
p33.cpp:76:24: error: invalid operands to binary expression ('basic_ostream<char, std::char_traits<char>>' and 'X')
  std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
  ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/system_error:262:5: note: candidate function template not viable: no known conversion from 'X' to 'const std::error_code' for 2nd argument
    operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:511:5: note: candidate function template not viable: no known conversion from 'X' to 'char' for 2nd argument
    operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:517:5: note: candidate function template not viable: no known conversion from 'X' to 'char' for 2nd argument
    operator<<(basic_ostream<char, _Traits>& __out, char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:523:5: note: candidate function template not viable: no known conversion from 'X' to 'signed char' for 2nd argument
    operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:528:5: note: candidate function template not viable: no known conversion from 'X' to 'unsigned char' for 2nd argument
    operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:538:5: note: candidate function template not viable: no known conversion from 'X' to 'wchar_t' for 2nd argument
    operator<<(basic_ostream<char, _Traits>&, wchar_t) = delete;
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:544:5: note: candidate function template not viable: no known conversion from 'X' to 'char8_t' for 2nd argument
    operator<<(basic_ostream<char, _Traits>&, char8_t) = delete;
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:549:5: note: candidate function template not viable: no known conversion from 'X' to 'char16_t' for 2nd argument
    operator<<(basic_ostream<char, _Traits>&, char16_t) = delete;
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:553:5: note: candidate function template not viable: no known conversion from 'X' to 'char32_t' for 2nd argument
    operator<<(basic_ostream<char, _Traits>&, char32_t) = delete;
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:606:5: note: candidate function template not viable: no known conversion from 'X' to 'const char *' for 2nd argument
    operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:619:5: note: candidate function template not viable: no known conversion from 'X' to 'const signed char *' for 2nd argument
    operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:624:5: note: candidate function template not viable: no known conversion from 'X' to 'const unsigned char *' for 2nd argument
    operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:634:5: note: candidate function template not viable: no known conversion from 'X' to 'const wchar_t *' for 2nd argument
    operator<<(basic_ostream<char, _Traits>&, const wchar_t*) = delete;
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:640:5: note: candidate function template not viable: no known conversion from 'X' to 'const char8_t *' for 2nd argument
    operator<<(basic_ostream<char, _Traits>&, const char8_t*) = delete;
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:645:5: note: candidate function template not viable: no known conversion from 'X' to 'const char16_t *' for 2nd argument
    operator<<(basic_ostream<char, _Traits>&, const char16_t*) = delete;
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:649:5: note: candidate function template not viable: no known conversion from 'X' to 'const char32_t *' for 2nd argument
    operator<<(basic_ostream<char, _Traits>&, const char32_t*) = delete;
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/ostream.tcc:321:5: note: candidate function template not viable: no known conversion from 'X' to 'const char *' for 2nd argument
    operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:506:5: note: candidate template ignored: deduced conflicting types for parameter '_CharT' ('char' vs. 'X')
    operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/string_view:619:5: note: candidate template ignored: could not match 'basic_string_view<_CharT, _Traits>' against 'X'
    operator<<(basic_ostream<_CharT, _Traits>& __os,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/basic_string.h:6468:5: note: candidate template ignored: could not match 'basic_string<_CharT, _Traits, _Alloc>' against 'X'
    operator<<(basic_ostream<_CharT, _Traits>& __os,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:559:5: note: candidate template ignored: could not match 'wchar_t' against 'char'
    operator<<(basic_ostream<wchar_t, _Traits>&, char8_t) = delete;
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:564:5: note: candidate template ignored: could not match 'wchar_t' against 'char'
    operator<<(basic_ostream<wchar_t, _Traits>&, char16_t) = delete;
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:568:5: note: candidate template ignored: could not match 'wchar_t' against 'char'
    operator<<(basic_ostream<wchar_t, _Traits>&, char32_t) = delete;
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:589:5: note: candidate template ignored: could not match 'const _CharT *' against 'X'
    operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:655:5: note: candidate template ignored: could not match 'wchar_t' against 'char'
    operator<<(basic_ostream<wchar_t, _Traits>&, const char8_t*) = delete;
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:660:5: note: candidate template ignored: could not match 'wchar_t' against 'char'
    operator<<(basic_ostream<wchar_t, _Traits>&, const char16_t*) = delete;
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:664:5: note: candidate template ignored: could not match 'wchar_t' against 'char'
    operator<<(basic_ostream<wchar_t, _Traits>&, const char32_t*) = delete;
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:773:5: note: candidate template ignored: requirement '__and_<std::__not_<std::is_lvalue_reference<std::basic_ostream<char, std::char_traits<char>> &>>, std::__is_convertible_to_basic_ostream<std::basic_ostream<char, std::char_traits<char>> &>, std::__is_insertable<std::basic_ostream<char, std::char_traits<char>> &, const X &, void>>::value' was not satisfied [with _Ostream = std::basic_ostream<char> &, _Tp = X]
    operator<<(_Ostream&& __os, const _Tp& __x)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:108:7: note: candidate function not viable: no known conversion from 'X' to 'std::basic_ostream<char>::__ostream_type &(*)(std::basic_ostream<char>::__ostream_type &)' (aka 'basic_ostream<char, std::char_traits<char>> &(*)(basic_ostream<char, std::char_traits<char>> &)') for 1st argument
      operator<<(__ostream_type& (*__pf)(__ostream_type&))
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:117:7: note: candidate function not viable: no known conversion from 'X' to 'std::basic_ostream<char>::__ios_type &(*)(std::basic_ostream<char>::__ios_type &)' (aka 'basic_ios<char, std::char_traits<char>> &(*)(basic_ios<char, std::char_traits<char>> &)') for 1st argument
      operator<<(__ios_type& (*__pf)(__ios_type&))
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:127:7: note: candidate function not viable: no known conversion from 'X' to 'std::ios_base &(*)(std::ios_base &)' for 1st argument
      operator<<(ios_base& (*__pf) (ios_base&))
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:166:7: note: candidate function not viable: no known conversion from 'X' to 'long' for 1st argument
      operator<<(long __n)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:170:7: note: candidate function not viable: no known conversion from 'X' to 'unsigned long' for 1st argument
      operator<<(unsigned long __n)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:174:7: note: candidate function not viable: no known conversion from 'X' to 'bool' for 1st argument
      operator<<(bool __n)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:178:7: note: candidate function not viable: no known conversion from 'X' to 'short' for 1st argument
      operator<<(short __n);
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:181:7: note: candidate function not viable: no known conversion from 'X' to 'unsigned short' for 1st argument
      operator<<(unsigned short __n)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:189:7: note: candidate function not viable: no known conversion from 'X' to 'int' for 1st argument
      operator<<(int __n);
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:192:7: note: candidate function not viable: no known conversion from 'X' to 'unsigned int' for 1st argument
      operator<<(unsigned int __n)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:201:7: note: candidate function not viable: no known conversion from 'X' to 'long long' for 1st argument
      operator<<(long long __n)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:205:7: note: candidate function not viable: no known conversion from 'X' to 'unsigned long long' for 1st argument
      operator<<(unsigned long long __n)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:220:7: note: candidate function not viable: no known conversion from 'X' to 'double' for 1st argument
      operator<<(double __f)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:224:7: note: candidate function not viable: no known conversion from 'X' to 'float' for 1st argument
      operator<<(float __f)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:232:7: note: candidate function not viable: no known conversion from 'X' to 'long double' for 1st argument
      operator<<(long double __f)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:245:7: note: candidate function not viable: no known conversion from 'X' to 'const void *' for 1st argument; take the address of the argument with &
      operator<<(const void* __p)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:250:7: note: candidate function not viable: no known conversion from 'X' to 'std::nullptr_t' for 1st argument
      operator<<(nullptr_t)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:276:7: note: candidate function not viable: no known conversion from 'X' to 'std::basic_ostream<char>::__streambuf_type *' (aka 'basic_streambuf<char, std::char_traits<char>> *') for 1st argument
      operator<<(__streambuf_type* __sb);
      ^
p33.cpp:76:42: error: use of undeclared identifier 'a'
  std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
                                         ^
5 warnings and 14 errors generated.

$ g++ p33.cpp -std=03 -o p33g -I. -Wall
p33.cpp:36:1: warning: identifier 'decltype' is a keyword in C++11 [-Wc++11-compat]
   36 | decltype(i()) j();
      | ^~~~~~~~
p33.cpp:16:9: error: 'b' was not declared in this scope
   16 | int n = b ? (1, S::x) // S::x is not odr-used here
      |         ^
p33.cpp:16:14: warning: left operand of comma operator has no effect [-Wunused-value]
   16 | int n = b ? (1, S::x) // S::x is not odr-used here
      |              ^
p33.cpp: In lambda function:
p33.cpp:20:8: error: 'n' is not captured
   20 |   [] { n = 1; }; // error, n is not odr-usable due to intervening lambda-expression
      |        ^
p33.cpp:20:4: note: the lambda has no capture-default
   20 |   [] { n = 1; }; // error, n is not odr-usable due to intervening lambda-expression
      |    ^
p33.cpp:19:12: note: 'int n' declared here
   19 | void f(int n) {
      |        ~~~~^
p33.cpp: In function 'void f(int)':
p33.cpp:20:15: warning: lambda expressions only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
   20 |   [] { n = 1; }; // error, n is not odr-usable due to intervening lambda-expression
      |               ^
p33.cpp: In member function 'void f(int)::A::f()':
p33.cpp:23:7: error: use of parameter from containing function
   23 |       n = 2;  // error, n is not odr-usable due to intervening function definition scope
      |       ^
p33.cpp:19:12: note: 'int n' declared here
   19 | void f(int n) {
      |        ~~~~^
p33.cpp: In function 'void f(int)':
p33.cpp:26:16: error: parameter 'n' may not appear in this context
   26 |   void g(int = n); // error, n is not odr-usable due to intervening function parameter scope
      |                ^
p33.cpp:27:15: error: parameter 'n' may not appear in this context
   27 |   [=](int k = n) {}; // error: n is not odr-usable due to being 2022
      |               ^
p33.cpp:27:19: warning: lambda expressions only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
   27 |   [=](int k = n) {}; // error: n is not odr-usable due to being 2022
      |                   ^
p33.cpp: In lambda function:
p33.cpp:29:24: warning: lambda expressions only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
   29 |   [&] { [n]{ return n; }; }; // OK
      |                        ^
p33.cpp: In function 'void f(int)':
p33.cpp:29:27: warning: lambda expressions only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
   29 |   [&] { [n]{ return n; }; }; // OK
      |                           ^
p33.cpp: At global scope:
p33.cpp:32:1: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
   32 | auto i() {      m
      | ^~~~
      | ----
p33.cpp:32:6: error: ISO C++ forbids declaration of 'i' with no type [-fpermissive]
   32 | auto i() {      m
      |      ^
p33.cpp:32:1: error: top-level declaration of 'i' specifies 'auto'
   32 | auto i() {      m
      | ^~~~
p33.cpp:32:1: error: storage class 'auto' invalid for function 'i'
p33.cpp: In function 'int i()':
p33.cpp:32:17: error: 'm' was not declared in this scope; did you mean 'tm'?
   32 | auto i() {      m
      |                 ^
      |                 tm
p33.cpp:33:20: error: expected primary-expression before ':' token
   33 |         struct A {}:
      |                    ^
p33.cpp:35:1: warning: no return statement in function returning non-void [-Wreturn-type]
   35 | }
      | ^
p33.cpp: At global scope:
p33.cpp:36:9: error: expected constructor, destructor, or type conversion before '(' token
   36 | decltype(i()) j();
      |         ^
p33.cpp:37:1: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
   37 | auto x = j();    // 2022 to
      | ^~~~
      | ----
p33.cpp:37:6: error: 'x' does not name a type
   37 | auto x = j();    // 2022 to
      |      ^
p33.cpp:53:7: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
   53 |   X x = 0;
      |       ^
p33.cpp:59:37: error: expected ')' before '{' token
   59 | inline void k(bool cond, void (*p)() {
      |              ~                      ^~
      |                                     )
p33.cpp: In function 'void k(bool, void (*)())':
p33.cpp:60:31: warning: lambda expressions only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
   60 |         if (cond) k(false, []{});
      |                               ^
p33.cpp: At global scope:
p33.cpp:62:43: warning: lambda expressions only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
   62 | inline void l(bool cond, void (*p)() = []{}){
      |                                           ^
p33.cpp:66:43: warning: lambda expressions only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
   66 |         void m(bool cond, void(*p)() = []{}){
      |                                           ^
p33.cpp: In function 'int main()':
p33.cpp:71:4: error: no matching function for call to 'f()'
   71 |   f();
      |   ~^~
p33.cpp:15:12: note: candidate: 'const int& f(const int&)'
   15 | const int &f(const int &r);
      |            ^
p33.cpp:15:12: note:   candidate expects 1 argument, 0 provided
p33.cpp:19:6: note: candidate: 'void f(int)'
   19 | void f(int n) {
      |      ^
p33.cpp:19:6: note:   candidate expects 1 argument, 0 provided
p33.cpp:72:3: error: 'g' was not declared in this scope
   72 |   g();
      |   ^
p33.cpp:75:4: error: too few arguments to function 'void k(bool, void (*)())'
   75 |   k();
      |   ~^~
p33.cpp:59:13: note: declared here
   59 | inline void k(bool cond, void (*p)() {
      |             ^
p33.cpp:76:29: error: 'X D::x' is private within this context
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                             ^
p33.cpp:53:5: note: declared private here
   53 |   X x = 0;
      |     ^
p33.cpp:76:24: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'X')
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |   ~~~~~~~~~~~~~~~~~~~~ ^~~~~~
      |             |               |
      |             |               X
      |             std::basic_ostream<char>
In file included from /usr/local/include/c++/12.1.0/iostream:39,
                 from p33.cpp:6:
/usr/local/include/c++/12.1.0/ostream:108:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  108 |       operator<<(__ostream_type& (*__pf)(__ostream_type&))
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:108:36: note:   no known conversion for argument 1 from 'X' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
  108 |       operator<<(__ostream_type& (*__pf)(__ostream_type&))
      |                  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/ostream:117:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
  117 |       operator<<(__ios_type& (*__pf)(__ios_type&))
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:117:32: note:   no known conversion for argument 1 from 'X' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
  117 |       operator<<(__ios_type& (*__pf)(__ios_type&))
      |                  ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/ostream:127:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  127 |       operator<<(ios_base& (*__pf) (ios_base&))
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:127:30: note:   no known conversion for argument 1 from 'X' to 'std::ios_base& (*)(std::ios_base&)'
  127 |       operator<<(ios_base& (*__pf) (ios_base&))
      |                  ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/ostream:166:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  166 |       operator<<(long __n)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:166:23: note:   no known conversion for argument 1 from 'X' to 'long int'
  166 |       operator<<(long __n)
      |                  ~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:170:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  170 |       operator<<(unsigned long __n)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:170:32: note:   no known conversion for argument 1 from 'X' to 'long unsigned int'
  170 |       operator<<(unsigned long __n)
      |                  ~~~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  174 |       operator<<(bool __n)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:174:23: note:   no known conversion for argument 1 from 'X' to 'bool'
  174 |       operator<<(bool __n)
      |                  ~~~~~^~~
In file included from /usr/local/include/c++/12.1.0/ostream:833:
/usr/local/include/c++/12.1.0/bits/ostream.tcc:91:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
   91 |     basic_ostream<_CharT, _Traits>::
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/ostream.tcc:92:22: note:   no known conversion for argument 1 from 'X' to 'short int'
   92 |     operator<<(short __n)
      |                ~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:181:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  181 |       operator<<(unsigned short __n)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:181:33: note:   no known conversion for argument 1 from 'X' to 'short unsigned int'
  181 |       operator<<(unsigned short __n)
      |                  ~~~~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/bits/ostream.tcc:105:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
  105 |     basic_ostream<_CharT, _Traits>::
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/ostream.tcc:106:20: note:   no known conversion for argument 1 from 'X' to 'int'
  106 |     operator<<(int __n)
      |                ~~~~^~~
/usr/local/include/c++/12.1.0/ostream:192:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  192 |       operator<<(unsigned int __n)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:192:31: note:   no known conversion for argument 1 from 'X' to 'unsigned int'
  192 |       operator<<(unsigned int __n)
      |                  ~~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:201:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  201 |       operator<<(long long __n)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:201:28: note:   no known conversion for argument 1 from 'X' to 'long long int'
  201 |       operator<<(long long __n)
      |                  ~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:205:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  205 |       operator<<(unsigned long long __n)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:205:37: note:   no known conversion for argument 1 from 'X' to 'long long unsigned int'
  205 |       operator<<(unsigned long long __n)
      |                  ~~~~~~~~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:220:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  220 |       operator<<(double __f)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:220:25: note:   no known conversion for argument 1 from 'X' to 'double'
  220 |       operator<<(double __f)
      |                  ~~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:224:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  224 |       operator<<(float __f)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:224:24: note:   no known conversion for argument 1 from 'X' to 'float'
  224 |       operator<<(float __f)
      |                  ~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:232:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  232 |       operator<<(long double __f)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:232:30: note:   no known conversion for argument 1 from 'X' to 'long double'
  232 |       operator<<(long double __f)
      |                  ~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:245:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  245 |       operator<<(const void* __p)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:245:30: note:   no known conversion for argument 1 from 'X' to 'const void*'
  245 |       operator<<(const void* __p)
      |                  ~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/bits/ostream.tcc:119:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]'
  119 |     basic_ostream<_CharT, _Traits>::
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/ostream.tcc:120:34: note:   no known conversion for argument 1 from 'X' to 'std::basic_ostream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>'}
  120 |     operator<<(__streambuf_type* __sbin)
      |                ~~~~~~~~~~~~~~~~~~^~~~~~
In file included 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,
                 from /usr/local/include/c++/12.1.0/ostream:38:
/usr/local/include/c++/12.1.0/bits/basic_string.h:3883:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
 3883 |     operator<<(basic_ostream<_CharT, _Traits>& __os,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3883:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   'X' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                             ^
/usr/local/include/c++/12.1.0/ostream:507:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
  507 |     operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:507:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   deduced conflicting types for parameter '_CharT' ('char' and 'X')
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                             ^
/usr/local/include/c++/12.1.0/ostream:517:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
  517 |     operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:517:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'char'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:523:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
  523 |     operator<<(basic_ostream<char, _Traits>& __out, char __c)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:523:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'char'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:534:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
  534 |     operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:534:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'signed char'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:539:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
  539 |     operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:539:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'unsigned char'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:598:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
  598 |     operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:598:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   mismatched types 'const _CharT*' and 'X'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                             ^
/usr/local/include/c++/12.1.0/bits/ostream.tcc:302:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
  302 |     operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/ostream.tcc:302:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'const char*'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:615:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
  615 |     operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:615:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'const char*'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:628:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
  628 |     operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:628:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'const signed char*'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:633:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
  633 |     operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:633:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'const unsigned char*'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
p33.cpp:76:42: error: 'a' was not declared in this scope
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                                          ^
rm: cannot remove 'p33g': No such file or directory

$ g++ p33.cpp -std=2b -o p33g -I. -Wall
p33.cpp:16:9: error: 'b' was not declared in this scope
   16 | int n = b ? (1, S::x) // S::x is not odr-used here
      |         ^
p33.cpp:16:14: warning: left operand of comma operator has no effect [-Wunused-value]
   16 | int n = b ? (1, S::x) // S::x is not odr-used here
      |              ^
p33.cpp: In lambda function:
p33.cpp:20:8: error: 'n' is not captured
   20 |   [] { n = 1; }; // error, n is not odr-usable due to intervening lambda-expression
      |        ^
p33.cpp:20:4: note: the lambda has no capture-default
   20 |   [] { n = 1; }; // error, n is not odr-usable due to intervening lambda-expression
      |    ^
p33.cpp:19:12: note: 'int n' declared here
   19 | void f(int n) {
      |        ~~~~^
p33.cpp: In member function 'void f(int)::A::f()':
p33.cpp:23:7: error: use of parameter from containing function
   23 |       n = 2;  // error, n is not odr-usable due to intervening function definition scope
      |       ^
p33.cpp:19:12: note: 'int n' declared here
   19 | void f(int n) {
      |        ~~~~^
p33.cpp: In function 'void f(int)':
p33.cpp:26:16: error: parameter 'n' may not appear in this context
   26 |   void g(int = n); // error, n is not odr-usable due to intervening function parameter scope
      |                ^
p33.cpp:27:15: error: parameter 'n' may not appear in this context
   27 |   [=](int k = n) {}; // error: n is not odr-usable due to being 2022
      |               ^
p33.cpp: In function 'auto i()':
p33.cpp:32:17: error: 'm' was not declared in this scope; did you mean 'tm'?
   32 | auto i() {      m
      |                 ^
      |                 tm
p33.cpp:33:20: error: expected primary-expression before ':' token
   33 |         struct A {}:
      |                    ^
p33.cpp: At global scope:
p33.cpp:37:6: error: 'void x' has incomplete type
   37 | auto x = j();    // 2022 to
      |      ^
p33.cpp:59:37: error: expected ')' before '{' token
   59 | inline void k(bool cond, void (*p)() {
      |              ~                      ^~
      |                                     )
p33.cpp: In function 'int main()':
p33.cpp:71:4: error: no matching function for call to 'f()'
   71 |   f();
      |   ~^~
p33.cpp:15:12: note: candidate: 'const int& f(const int&)'
   15 | const int &f(const int &r);
      |            ^
p33.cpp:15:12: note:   candidate expects 1 argument, 0 provided
p33.cpp:19:6: note: candidate: 'void f(int)'
   19 | void f(int n) {
      |      ^
p33.cpp:19:6: note:   candidate expects 1 argument, 0 provided
p33.cpp:72:3: error: 'g' was not declared in this scope
   72 |   g();
      |   ^
p33.cpp:75:4: error: too few arguments to function 'void k(bool, void (*)())'
   75 |   k();
      |   ~^~
p33.cpp:59:13: note: declared here
   59 | inline void k(bool cond, void (*p)() {
      |             ^
p33.cpp:76:29: error: 'X D::x' is private within this context
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                             ^
p33.cpp:53:5: note: declared private here
   53 |   X x = 0;
      |     ^
p33.cpp:76:24: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'X')
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |   ~~~~~~~~~~~~~~~~~~~~ ^~~~~~
      |             |               |
      |             |               X
      |             std::basic_ostream<char>
In file included from /usr/local/include/c++/12.1.0/iostream:39,
                 from p33.cpp:6:
/usr/local/include/c++/12.1.0/ostream:108:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  108 |       operator<<(__ostream_type& (*__pf)(__ostream_type&))
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:108:36: note:   no known conversion for argument 1 from 'X' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
  108 |       operator<<(__ostream_type& (*__pf)(__ostream_type&))
      |                  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/ostream:117:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
  117 |       operator<<(__ios_type& (*__pf)(__ios_type&))
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:117:32: note:   no known conversion for argument 1 from 'X' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
  117 |       operator<<(__ios_type& (*__pf)(__ios_type&))
      |                  ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/ostream:127:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  127 |       operator<<(ios_base& (*__pf) (ios_base&))
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:127:30: note:   no known conversion for argument 1 from 'X' to 'std::ios_base& (*)(std::ios_base&)'
  127 |       operator<<(ios_base& (*__pf) (ios_base&))
      |                  ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/ostream:166:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  166 |       operator<<(long __n)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:166:23: note:   no known conversion for argument 1 from 'X' to 'long int'
  166 |       operator<<(long __n)
      |                  ~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:170:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  170 |       operator<<(unsigned long __n)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:170:32: note:   no known conversion for argument 1 from 'X' to 'long unsigned int'
  170 |       operator<<(unsigned long __n)
      |                  ~~~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  174 |       operator<<(bool __n)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:174:23: note:   no known conversion for argument 1 from 'X' to 'bool'
  174 |       operator<<(bool __n)
      |                  ~~~~~^~~
In file included from /usr/local/include/c++/12.1.0/ostream:833:
/usr/local/include/c++/12.1.0/bits/ostream.tcc:91:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
   91 |     basic_ostream<_CharT, _Traits>::
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/ostream.tcc:92:22: note:   no known conversion for argument 1 from 'X' to 'short int'
   92 |     operator<<(short __n)
      |                ~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:181:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  181 |       operator<<(unsigned short __n)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:181:33: note:   no known conversion for argument 1 from 'X' to 'short unsigned int'
  181 |       operator<<(unsigned short __n)
      |                  ~~~~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/bits/ostream.tcc:105:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
  105 |     basic_ostream<_CharT, _Traits>::
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/ostream.tcc:106:20: note:   no known conversion for argument 1 from 'X' to 'int'
  106 |     operator<<(int __n)
      |                ~~~~^~~
/usr/local/include/c++/12.1.0/ostream:192:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  192 |       operator<<(unsigned int __n)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:192:31: note:   no known conversion for argument 1 from 'X' to 'unsigned int'
  192 |       operator<<(unsigned int __n)
      |                  ~~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:201:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  201 |       operator<<(long long __n)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:201:28: note:   no known conversion for argument 1 from 'X' to 'long long int'
  201 |       operator<<(long long __n)
      |                  ~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:205:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  205 |       operator<<(unsigned long long __n)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:205:37: note:   no known conversion for argument 1 from 'X' to 'long long unsigned int'
  205 |       operator<<(unsigned long long __n)
      |                  ~~~~~~~~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:220:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  220 |       operator<<(double __f)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:220:25: note:   no known conversion for argument 1 from 'X' to 'double'
  220 |       operator<<(double __f)
      |                  ~~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:224:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  224 |       operator<<(float __f)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:224:24: note:   no known conversion for argument 1 from 'X' to 'float'
  224 |       operator<<(float __f)
      |                  ~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:232:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  232 |       operator<<(long double __f)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:232:30: note:   no known conversion for argument 1 from 'X' to 'long double'
  232 |       operator<<(long double __f)
      |                  ~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:245:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  245 |       operator<<(const void* __p)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:245:30: note:   no known conversion for argument 1 from 'X' to 'const void*'
  245 |       operator<<(const void* __p)
      |                  ~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/ostream:250:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
  250 |       operator<<(nullptr_t)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:250:18: note:   no known conversion for argument 1 from 'X' to 'std::nullptr_t'
  250 |       operator<<(nullptr_t)
      |                  ^~~~~~~~~
/usr/local/include/c++/12.1.0/ostream:257:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const volatile void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  257 |       operator<<(const volatile void* __p)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:257:39: note:   no known conversion for argument 1 from 'X' to 'const volatile void*'
  257 |       operator<<(const volatile void* __p)
      |                  ~~~~~~~~~~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/bits/ostream.tcc:119:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]'
  119 |     basic_ostream<_CharT, _Traits>::
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/ostream.tcc:120:34: note:   no known conversion for argument 1 from 'X' to 'std::basic_ostream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>'}
  120 |     operator<<(__streambuf_type* __sbin)
      |                ~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/local/include/c++/12.1.0/bits/basic_string.h:48,
                 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,
                 from /usr/local/include/c++/12.1.0/ostream:38:
/usr/local/include/c++/12.1.0/string_view:672:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
  672 |     operator<<(basic_ostream<_CharT, _Traits>& __os,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/string_view:672:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   'X' is not derived from 'std::basic_string_view<_CharT, _Traits>'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                             ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3883:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 3883 |     operator<<(basic_ostream<_CharT, _Traits>& __os,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3883:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   'X' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                             ^
In file included from /usr/local/include/c++/12.1.0/bits/ios_base.h:46:
/usr/local/include/c++/12.1.0/system_error:279:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
  279 |     operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/system_error:279:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'const std::error_code&'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:507:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
  507 |     operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:507:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   deduced conflicting types for parameter '_CharT' ('char' and 'X')
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                             ^
/usr/local/include/c++/12.1.0/ostream:517:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
  517 |     operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:517:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'char'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:523:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
  523 |     operator<<(basic_ostream<char, _Traits>& __out, char __c)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:523:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'char'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:534:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
  534 |     operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:534:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'signed char'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:539:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
  539 |     operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:539:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'unsigned char'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:548:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, wchar_t)' (deleted)
  548 |     operator<<(basic_ostream<char, _Traits>&, wchar_t) = delete;
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:548:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'wchar_t'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:553:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char8_t)' (deleted)
  553 |     operator<<(basic_ostream<char, _Traits>&, char8_t) = delete;
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:553:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'char8_t'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:558:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char16_t)' (deleted)
  558 |     operator<<(basic_ostream<char, _Traits>&, char16_t) = delete;
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:558:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'char16_t'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:562:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char32_t)' (deleted)
  562 |     operator<<(basic_ostream<char, _Traits>&, char32_t) = delete;
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:562:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'char32_t'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:568:5: note: candidate: 'template<class _Traits> std::basic_ostream<wchar_t, _Traits>& std::operator<<(basic_ostream<wchar_t, _Traits>&, char8_t)' (deleted)
  568 |     operator<<(basic_ostream<wchar_t, _Traits>&, char8_t) = delete;
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:568:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   mismatched types 'wchar_t' and 'char'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                             ^
/usr/local/include/c++/12.1.0/ostream:573:5: note: candidate: 'template<class _Traits> std::basic_ostream<wchar_t, _Traits>& std::operator<<(basic_ostream<wchar_t, _Traits>&, char16_t)' (deleted)
  573 |     operator<<(basic_ostream<wchar_t, _Traits>&, char16_t) = delete;
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:573:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   mismatched types 'wchar_t' and 'char'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                             ^
/usr/local/include/c++/12.1.0/ostream:577:5: note: candidate: 'template<class _Traits> std::basic_ostream<wchar_t, _Traits>& std::operator<<(basic_ostream<wchar_t, _Traits>&, char32_t)' (deleted)
  577 |     operator<<(basic_ostream<wchar_t, _Traits>&, char32_t) = delete;
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:577:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   mismatched types 'wchar_t' and 'char'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                             ^
/usr/local/include/c++/12.1.0/ostream:598:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
  598 |     operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:598:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   mismatched types 'const _CharT*' and 'X'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                             ^
/usr/local/include/c++/12.1.0/bits/ostream.tcc:302:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
  302 |     operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/ostream.tcc:302:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'const char*'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:615:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
  615 |     operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:615:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'const char*'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:628:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
  628 |     operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:628:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'const signed char*'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:633:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
  633 |     operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:633:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'const unsigned char*'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:642:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const wchar_t*)' (deleted)
  642 |     operator<<(basic_ostream<char, _Traits>&, const wchar_t*) = delete;
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:642:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'const wchar_t*'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:647:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char8_t*)' (deleted)
  647 |     operator<<(basic_ostream<char, _Traits>&, const char8_t*) = delete;
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:647:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'const char8_t*'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:652:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char16_t*)' (deleted)
  652 |     operator<<(basic_ostream<char, _Traits>&, const char16_t*) = delete;
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:652:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'const char16_t*'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:656:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char32_t*)' (deleted)
  656 |     operator<<(basic_ostream<char, _Traits>&, const char32_t*) = delete;
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:656:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   cannot convert 'd2.D::x' (type 'X') to type 'const char32_t*'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                          ~~~^
/usr/local/include/c++/12.1.0/ostream:662:5: note: candidate: 'template<class _Traits> std::basic_ostream<wchar_t, _Traits>& std::operator<<(basic_ostream<wchar_t, _Traits>&, const char8_t*)' (deleted)
  662 |     operator<<(basic_ostream<wchar_t, _Traits>&, const char8_t*) = delete;
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:662:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   mismatched types 'wchar_t' and 'char'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                             ^
/usr/local/include/c++/12.1.0/ostream:667:5: note: candidate: 'template<class _Traits> std::basic_ostream<wchar_t, _Traits>& std::operator<<(basic_ostream<wchar_t, _Traits>&, const char16_t*)' (deleted)
  667 |     operator<<(basic_ostream<wchar_t, _Traits>&, const char16_t*) = delete;
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:667:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   mismatched types 'wchar_t' and 'char'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                             ^
/usr/local/include/c++/12.1.0/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<wchar_t, _Traits>& std::operator<<(basic_ostream<wchar_t, _Traits>&, const char32_t*)' (deleted)
  671 |     operator<<(basic_ostream<wchar_t, _Traits>&, const char32_t*) = delete;
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:671:5: note:   template argument deduction/substitution failed:
p33.cpp:76:29: note:   mismatched types 'wchar_t' and 'char'
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |                             ^
/usr/local/include/c++/12.1.0/ostream:754:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
  754 |     operator<<(_Ostream&& __os, const _Tp& __x)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:754:5: note:   template argument deduction/substitution failed:
/usr/local/include/c++/12.1.0/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_ostream<char>&; _Tp = X]':
p33.cpp:76:29:   required from here
/usr/local/include/c++/12.1.0/ostream:754:5: error: template constraint failure for 'template<class _Os, class _Tp>  requires (__derived_from_ios_base<_Os>) && requires(_Os& __os, const _Tp& __t) {__os << __t;} using __rvalue_stream_insertion_t = _Os&&'
/usr/local/include/c++/12.1.0/ostream:754:5: note: constraints not satisfied
/usr/local/include/c++/12.1.0/ostream: In substitution of 'template<class _Os, class _Tp>  requires (__derived_from_ios_base<_Os>) && requires(_Os& __os, const _Tp& __t) {__os << __t;} using __rvalue_stream_insertion_t = _Os&& [with _Os = std::basic_ostream<char>&; _Tp = X]':
/usr/local/include/c++/12.1.0/ostream:754:5:   required by substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_ostream<char>&; _Tp = X]'
p33.cpp:76:29:   required from here
/usr/local/include/c++/12.1.0/ostream:721:13:   required for the satisfaction of '__derived_from_ios_base<_Os>' [with _Os = std::basic_ostream<char, std::char_traits<char> >&]
/usr/local/include/c++/12.1.0/ostream:721:39: note: the expression 'is_class_v<_Tp> [with _Tp = std::basic_ostream<char, std::char_traits<char> >&]' evaluated to 'false'
  721 |     concept __derived_from_ios_base = is_class_v<_Tp>
      |                                       ^~~~~~~~~~~~~~~
p33.cpp:76:42: error: 'a' was not declared in this scope
   76 |   std::cout << "d2.x " <<d2.x <<" a " << a.s << std::endl;
      |  
```

## 検討事項(agenda)


# 参考資料(reference)

C++ Error Message Collection(1)does not name a type, 11 articles

https://qiita.com/kaizen_nagoya/items/acb9f1a9b5aad6df06bd

dockerにclang

https://qiita.com/kaizen_nagoya/items/8829ffeee397eda50e80

docker gnu(gcc/g++) and llvm(clang/clang++)

https://qiita.com/drafts/059874ea39c4de64c0f7

コンパイル用shell script C版(clangとgcc)とC++版(clang++とg++)

https://qiita.com/kaizen_nagoya/items/74220c0577a512c2d7da

C++N4606 Working Draft 2016, ISO/IEC 14882, C++ standardのコード断片をコンパイルするためにしていること
https://qiita.com/kaizen_nagoya/items/a8d7ee2f2e29e76c19c1

コンパイル用shell script C版(clangとgcc)とC++版(clang++とg++)
https://qiita.com/kaizen_nagoya/items/74220c0577a512c2d7da

Clang/Clang++(LLVM) gcc/g++(GNU) コンパイラ警告等比較
https://qiita.com/kaizen_nagoya/items/9a82b958cc3aeef0403f

C++2003とC++2017でコンパイルエラーになるならない事例集
https://qiita.com/kaizen_nagoya/items/a13ea3823441c430edff

Qiitaに投稿するCのStyle例(暫定)
https://qiita.com/kaizen_nagoya/items/946df1528a6a1ef2bc0d

cpprefjpのdecltypeをコンパイル試験
https://qiita.com/kaizen_nagoya/items/090909af702f0d5d8a67

MISRA C++ 5-0-16
https://qiita.com/kaizen_nagoya/items/7df2d4e05db724752a74

C++ Templates Part1 BASICS Chapter 3. Class Templates 3.2 Use of Class Template Stack stack1test.cpp
https://qiita.com/kaizen_nagoya/items/cd5fc49106fad5a4e9ed

ISO/IEC TS 17961:2013 C Secure Coding Rules(1) All list(to be confirmed)
https://qiita.com/kaizen_nagoya/items/54e056195c4f11b850a1

C言語（C++)に対する誤解、曲解、無理解、爽快。
https://qiita.com/kaizen_nagoya/items/3f3992c9722c1cee2e3a

C Puzzle Bookの有り難み5つ、C言語規格及びCコンパイラの特性を認識
https://qiita.com/kaizen_nagoya/items/d89a48c1536a02ecdec9

'wchar.h' file not found で困った clang++ macOS
https://qiita.com/kaizen_nagoya/items/de15cd46d657517fac11

Open POSIX Test Suiteの使い方を調べはじめました
https://qiita.com/kaizen_nagoya/items/644d5e407f5faf96e6dc

MISRA-C 2012 Referenceに掲載している文献の入手可能性を確認
https://qiita.com/kaizen_nagoya/items/96dc8b125e462d5575bb

どうやって MISRA Example Suiteをコンパイルするか
https://qiita.com/kaizen_nagoya/items/fbdbff5ff696e2ca7f00

MISRA C まとめ #include <misra_c.h>
https://qiita.com/kaizen_nagoya/items/f1a79a7cbd281607c7c9

「C++完全理解ガイド」の同意できること上位10
https://qiita.com/kaizen_nagoya/items/aa5744e0c4a8618c7671

# 文書履歴(document history)
ver. 0.01 初稿 　20220617
ver. 0.02 ありがとう追記 20230622
### 最後までおよみいただきありがとうございました。

いいね　💚、フォローをお願いします。

####  Thank you very much for reading to the last sentence.

Please press the like icon 💚　and follow me for your happy life.