LoginSignup
0
0

More than 1 year has passed since last update.

Annex C (informative) Compatibility [diff] C++N4910:2022 (717) p1777.cpp

Posted at

はじめに(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

bash
$ docker run -v /Users/ogawakiyoshi/n4910:/Users/ogawakiyoshi/n4910 -it kaizenjapan/n4910 /bin/bash

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++

読書感想文

CコンパイラによるC言語規格の読書感想文として掲載しています。

コンパイル実験が、C++N4910に対する、G++とClang++による感想文だということご理解いただけると幸いです。

読書感想文は人間かAIだけが作るものとは限りません。
本(電子書籍を含む)を入力として、その内容に対する文字列を読書感想文として受け止めましょう。
元の文章をあり方、コンパイルできるように電子化しておくこと、コンパイラが解釈可能な断片の作り方など。

個人開発

Cコンパイラの試験を一人でもくもくとやっているのは個人開発の一つの姿です。

<この項は書きかけです。順次追記します。>

編纂器(Compiler)

clang++ --version

20220826 以前

Debian clang version 14.0.5-++20220610033153+c12386ae247c-1~exp1~20220610153237.151
Target: x86_64-pc-linux-gnu, Thread model: posix, InstalledDir: /usr/bin

20220827 以降

Debian clang version 14.0.6-++20220622053050+f28c006a5895-1~exp1~20220622173135.152
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.

Annex C (informative) Compatibility [diff] C++N4910:2022 (717) p1777.cpp

算譜(source code)

p1777.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 * n4910 = "Annex C (informative) Compatibility  [diff] C++N4910:2022 (717) p1777.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;

// C.1 C++ and ISO C++ 2020 [diff.cpp20]
// C.1.1 General [diff.cpp20.general]
//  Subclause C.1 lists the differences between C++ and ISO C++ 2020 (ISO/IEC 14882:2020, Programming Languages — C++), by the chapters of this document.
// C.1.2 Clause 5: lexical conventions [diff.cpp20.lex]
//  Affected subclause: 5.10
// Change: Previously valid identifiers containing characters not present in UAX #44 properties XID_Start or XID_Continue, or not in Normalization Form C, are now rejected.
// Rationale: Prevent confusing characters in identifiers. Requiring normalization of names ensures consistent linker behavior.
// Effect on original feature: Some identifiers are no longer well-formed.
//  Affected subclause: 5.13.5
// Change: Concatenated string-literals can no longer have conflicting encoding-prefixes.
// Rationale: Removal of unimplemented conditionally-supported feature.
// Effect on original feature: Concatenation of string-literals with different encoding-prefixes is now ill-formed.
// [Example 1:
auto c = L"a" U"b"; // was conditionally-supported; now ill-formed
// C.1.3 Clause 7: expressions [diff.cpp20.expr]
//  Affected subclause: 7.6.1.2
// Change: Change the meaning of comma in subscript expressions.
// Rationale: Enable repurposing a deprecated syntax to support multidimensional indexing.
// Effect on original feature: Valid C++ 2020 code that uses a comma expression within a subscript expression may fail to compile. For example: arr[1, 2] // was equivalent to arr[(1, 2)],
// now equivalent to arr.operator[](1, 2) or ill-formed
// C.1.4 Clause 16: library introduction [diff.cpp20.library]
//  Affected subclause: 16.4.2.3
// Change: New headers.
// Rationale: New functionality.
// Effect on original feature: The following C++ headers are new: <expected> (22.8.2), <stdatomic.h> (33.5.12), <spanstream> (31.9.2), and <stacktrace> (19.6.2). Valid C++ 2020 code that #includes headers with these names may be invalid in this revision of C++.
// C.1.5 Clause 22: general utilities library [diff.cpp20.utilities]
//  Affected subclause: 22.14
// Change: Signature changes: format, format_to, vformat_to, format_to_n, formatted_size. Removal of format_args_t.
// Rationale: Improve safety via compile-time format string checks, avoid unnecessary template instantiations. Effect on original feature: Valid C++ 2020 code that contained errors in format strings or relied on previous format string signatures or format_args_t may become ill-formed. For example:
auto s = std::format("{:d}", "I am not a number"); // ill-formed,
// previously threw format_error
//  Affected subclause: 22.14
// Change: Signature changes: format, format_to, format_to_n, formatted_size.
// Rationale: Enable formatting of views that do not support iteration when const-qualified and that are not copyable.
// Effect on original feature: Valid C++ 2020 code that passes bit fields to formatting functions may become ill-formed. For example:
struct tiny {
    int bit: 1;
};
auto t = tiny();
std::format("{}", t.bit);
// ill-formed, previously returned "0"
// C.1.6 Clause 24: containers library [diff.cpp20.containers]
//  Affected subclauses: 24.2.7 and 24.2.8
// Change: Heterogeneous extract and erase overloads for associative containers.
// Rationale: Improve efficiency of erasing elements from associative containers.
// Effect on original feature: Valid C++ 2020 code may fail to compile in this revision of C++. For example:
struct B {
    auto operator<=>(const B&) const = default;
};
struct D : private B {
    void f(std::set<B, std::less<>>& s) {
        s.erase(*this); // ill formed; previously well-formed }
    };
// C.2 C++ and ISO C++ 2017 [diff.cpp17]
// C.2.1 General [diff.cpp17.general]
//  Subclause C.2 lists the differences between C++ and ISO C++ 2017 (ISO/IEC 14882:2017, Programming Languages — C++), by the chapters of this document.
// C.2.2 Clause 5: lexical conventions [diff.cpp17.lex]
//  Affected subclauses: 5.4, 10.1, 10.3, 15.1, 15.4, and 15.5
// Change: New identifiers with special meaning.
// Rationale: Required for new features.
// Effect on original feature: Logical lines beginning with module or import may be interpreted differently in this revision of C++.
// [Example 1:
    class module {};
    module m1;
    module *m2;
    class import {};
    import j1;
    ::import j2;
// was variable declaration; now module-declaration // variable declaration
// was variable declaration; now module-import-declaration // variable declaration
//  Affected subclause: 5.8
// Change: header-name tokens are formed in more contexts.
// Rationale: Required for new features.
// Effect on original feature: When the identifier import is followed by a < character, a header-name token may be formed.
// [Example 2:
    template<typename> class import {};
    import<int> f();
    ::import<int> g();
// ill-formed; previously well-formed // OK
//  Affected subclause: 5.11
// Change: New keywords.
// Rationale: Required for new features.
// — The char8_t keyword is added to differentiate the types of ordinary and UTF-8 literals (5.13.5). — The concept keyword is added to enable the definition of concepts (13.7.9).
// — The consteval keyword is added to declare immediate functions (9.2.6).
// — The constinit keyword is added to prevent unintended dynamic initialization (9.2.7).
// — The co_await, co_yield, and co_return keywords are added to enable the definition of coroutines (9.5.4).
// — The requires keyword is added to introduce constraints through a requires-clause (13.1) or a requires- expression (7.5.7).
//  Affected subclause: 5.12
// Change: New operator <=>.
// Rationale: Necessary for new functionality.
// Effect on original feature: Valid C++ 2017 code that contains a <= token immediately followed by a > token may be ill-formed or have different semantics in this revision of C++:
    namespace N {
    struct X {};
    bool operator<=(X, X);
    template<bool(X, X)> struct Y {};
    Y<operator<=> y; // ill-formed; previously well-formed
    }
//  Affected subclause: 5.13
// Change: Type of UTF-8 string and character literals.
// Rationale: Required for new features. The changed types enable function overloading, template specialization, and type deduction to distinguish ordinary and UTF-8 string and character literals.
// Effect on original feature: Valid C++ 2017 code that depends on UTF-8 string literals having type “array of const char” and UTF-8 character literals having type “char” is not valid in this revision of C++.
// Effect on original feature: Valid C++ 2017 code using char8_t, concept, consteval, constinit, co_- await, co_yield, co_return, or requires as an identifier is not valid in this revision of C++.
    const auto *u8s = u8"text";
    const char *ps = u8s;
    auto u8c = u8'c';
               char *pc = &u8c;
    std::string s = u8"text";
    void f(const char *s);
    f(u8"text");
    template<typename> struct ct;
    template<> struct ct<char> {
        using type = char;
    };
    ct<decltype(u8'c')>::type x;
// C.2.3 Clause 6: basics [diff.cpp17.basic]
// u8s previously deduced as const char*; now deduced as const char8_t* // il l-formed; previously wel l-formed
// u8c previously deduced as char; now deduced as char8_t // il l-formed; previously wel l-formed
// il l-formed; previously wel l-formed // il l-formed; previously wel l-formed
// ill-formed; previously well-formed.
//  Affected subclause: 6.7.3
// Change: A pseudo-destructor call ends the lifetime of the object to which it is applied.
// Rationale: Increase consistency of the language model.
// Effect on original feature: Valid ISO C++ 2017 code may be ill-formed or have undefined behavior in this revision of C++.
// [Example 1:
    int f() {
        int a = 123;
        using T = int;
        a.~T();
        return a;
// undefined behavior; previously returned 123
    }
//  Affected subclause: 6.9.2.2
// Change: Except for the initial release operation, a release sequence consists solely of atomic read-modify- write operations.
// Rationale: Removal of rarely used and confusing feature.
// Effect on original feature: If a memory_order_release atomic store is followed by a memory_order_- relaxed store to the same variable by the same thread, then reading the latter value with a memory_order_- acquire load no longer provides any “happens before” guarantees, even in the absence of intervening stores by another thread.
// C.2.4 Clause 7: expressions [diff.cpp17.expr]
//  Affected subclause: 7.5.5.3
// Change: Implicit lambda capture may capture additional entities.
// Rationale: Rule simplification, necessary to resolve interactions with constexpr if.
// Effect on original feature: Lambdas with a capture-default may capture local entities that were not captured in C++ 2017 if those entities are only referenced in contexts that do not result in an odr-use.
// C.2.5 Clause 9: declarations [diff.cpp17.dcl.dcl]
//  Affected subclause: 9.2.4
// Change: Unnamed classes with a typedef name for linkage purposes can contain only C-compatible constructs.
// Rationale: Necessary for implementability.
// Effect on original feature: Valid C++ 2017 code may be ill-formed in this revision of C++.
    typedef struct {
        void f() {} // ill-formed; previously well-formed
    } S;
//  Affected subclause: 9.3.4.7
// Change: A function cannot have different default arguments in different translation units.
// Rationale: Required for modules support.
// Effect on original feature: Valid C++ 2017 code may be ill-formed in this revision of C++, with no diagnostic required.
// Translation unit 1
    int f(int a = 42);
    int g() {
        return f();
    }
// Translation unit 2
    int f(int a = 76) {
        return a;
    }
    int g();
    int main() {
        return g();
    }
// ill-formed, no diagnostic required; previously well-formed // used to return 42
//  Affected subclause: 9.4.2
// Change: A class that has user-declared constructors is never an aggregate.
// Rationale: Remove potentially error-prone aggregate initialization which may apply notwithstanding the declared constructors of a class.
// Effect on original feature: Valid C++ 2017 code that aggregate-initializes a type with a user-declared constructor may be ill-formed or have different semantics in this revision of C++.
    struct A {
        A() = delete;
    };
    struct B {
        B() = default;
        int i = 0;
    };
// not an aggregate; previously an aggregate
// not an aggregate; previously an aggregate
    struct C {
        C(C&&) = default;
        int a, b;
    };
    A a{};
    B b = {1};
    auto* c = new C {
        2, 3
    };
    struct Y;
    struct X {
        operator Y();
    };
    struct Y {
        Y(const Y&) = default;
        X x;
    };
    Y y{X{}};
// not an aggregate; previously an aggregate
// il l-formed; previously wel l-formed // il l-formed; previously wel l-formed // il l-formed; previously wel l-formed
// not an aggregate; previously an aggregate
// copy constructor call; previously aggregate-initialization
//  Affected subclause: 9.4.5
// Change: Boolean conversion from a pointer or pointer-to-member type is now a narrowing conversion. Rationale: Catches bugs.
// Effect on original feature: Valid C++ 2017 code may fail to compile in this revision of C++. For example:
    bool y[] = { "bc" }; // ill-formed; previously well-formed
// C.2.6 Clause 11: classes [diff.cpp17.class]
//  Affected subclauses: 11.4.5 and 11.4.8.3
// Change: The class name can no longer be used parenthesized immediately after an explicit decl-specifier in a constructor declaration. The conversion-function-id can no longer be used parenthesized immediately after an explicit decl-specifier in a conversion function declaration.
// Rationale: Necessary for new functionality.
// Effect on original feature: Valid C++ 2017 code may fail to compile in this revision of C++. For example:
    struct S {
        explicit (S)(const S&);
        explicit (operator int)();
        explicit(true) (S)(int);
    };
// ill-formed; previously well-formed // ill-formed; previously well-formed // OK
//  Affected subclauses: 11.4.5 and 11.4.7
// Change: A simple-template-id is no longer valid as the declarator-id of a constructor or destructor. Rationale: Remove potentially error-prone option for redundancy.
// Effect on original feature: Valid C++ 2017 code may fail to compile in this revision of C++. For example:
    template<class T>
    struct A {
        A<T>(); A(int); ~A<T>();
// error: simple-template-id not allowed for constructor // OK, injected-class-name used
// error: simple-template-id not allowed for destructor
    };
//  Affected subclause: 11.9.6
// Change: A function returning an implicitly movable entity may invoke a constructor taking an rvalue reference to a type different from that of the returned expression. Function and catch-clause parameters can be thrown using move constructors.
// Rationale: Side effect of making it easier to write more efficient code that takes advantage of moves. Effect on original feature: Valid C++ 2017 code may fail to compile or have different semantics in this revision of C++. For example:
    struct base {
        base();
        base(base const &);
private:
        base(base &&);
    };
    struct derived : base {};
    base f(base b) {
        throw b;
        derived d;
        return d;
    }
// error: base(base &&) is private // error: base(base &&) is private
    struct S {
        S(const char *s) : m(s) { }
        S(const S&) = default;
        S(S&& other) : m(other.m) {
            other.m = nullptr;
        }
        const char * m;
    };
    S consume(S&& s) {
        return s;
    }
    void g() {
        S s("text");
        consume(static_cast<S&&>(s));
        char c = *s.m;
    }
// undefined behavior; previously ok
// C.2.7 Clause 12: overloading [diff.cpp17.over]
//  Affected subclause: 12.2.2.3
// Change: Equality and inequality expressions can now find reversed and rewritten candidates.
// Rationale: Improve consistency of equality with three-way comparison and make it easier to write the full complement of equality operations.
// Effect on original feature: Equality and inequality expressions between two objects of different types, where one is convertible to the other, could invoke a different operator. Equality and inequality expressions between two objects of the same type could become ambiguous.
    struct A {
        operator int() const;
    };
    bool operator==(A, int); // #1
// #2 is built-in candidate:
    bool operator==(int, int); // #3 is built-in candidate:
    bool operator!=(int, int);
    int check(A x, A y) {
        return (x == y) +
               (10 == x) +
               (10 != x);
    }
// C.2.8 Clause 13: templates [diff.cpp17.temp]
// ill-formed; previously well-formed // calls #1, previously selected #2 // calls #1, previously selected #3
//  Affected subclause: 13.3
// Change: An unqualified-id that is followed by a < and for which name lookup finds nothing or finds a function will be treated as a template-name in order to potentially cause argument dependent lookup to be performed.
// Rationale: It was problematic to call a function template with an explicit template argument list via argument dependent lookup because of the need to have a template with the same name visible via normal lookup.
// Effect on original feature: Previously valid code that uses a function name as the left operand of a < operator would become ill-formed.
    struct A {};
    bool operator<(void (*fp)(), A);
    void f() {}
    int main() {
        A a;
        f < a; // ill-formed; previously well-formed (f) < a; // still well formed
    }
// C.2.9 Clause 14: exception handling [diff.cpp17.except]
//  Affected subclause: 14.5
// Change: Remove throw() exception specification.
// Rationale: Removal of obsolete feature that has been replaced by noexcept.
// Effect on original feature: A valid C++ 2017 function declaration, member function declaration, function pointer declaration, or function reference declaration that uses throw() for its exception specification will be rejected as ill-formed in this revision of C++. It should simply be replaced with noexcept for no change of meaning since C++ 2017.
// [Note 1: There is no way to write a function declaration that is non-throwing in this revision of C++ and is also non-throwing in C++ 2003 except by using the preprocessor to generate a different token sequence in each case.
// C.2.10 Clause 16: library introduction [diff.cpp17.library]
//  Affected subclause: 16.4.2.3
// Change: New headers.
// Rationale: New functionality.
// Effect on original feature: The following C++ headers are new: <barrier> (33.9.3.2), <bit> (22.15.2), <charconv> (22.13.1), <compare> (17.11.1), <concepts> (18.3), <coroutine> (17.12.2), <format> (22.14.1), <latch> (33.9.2.2), <numbers> (28.8.1), <ranges> (26.2), <semaphore> (33.8.2), <source_location> (17.8.1), <span> (24.7.2), <stop_token> (33.3.2), <syncstream> (31.11.1), and <version> (17.3.1). Valid C++ 2017 code that #includes headers with these names may be invalid in this revision of C++.
// Affected subclause: 16.4.2.3
// Change: Remove vacuous C++ header files.
// Rationale: The empty headers implied a false requirement to achieve C compatibility with the C++ headers. Effect on original feature: A valid C++ 2017 program that #includes any of the following headers may fail to compile: <ccomplex>, <ciso646>, <cstdalign>, <cstdbool>, and <ctgmath>. To retain the same behavior:
// — a #include of <ccomplex> can be replaced by a #include of <complex> (28.4.2),
// — a #include of <ctgmath> can be replaced by a #include of <cmath> (28.7.1) and a #include of <complex>, and
// — a #include of <ciso646>, <cstdalign>, or <cstdbool> can simply be removed.
//  Affected subclauses: 24.3.9 and 24.3.10
// Change: Return types of remove, remove_if, and unique changed from void to container::size_type. Rationale: Improve efficiency and convenience of finding number of removed elements.
// Effect on original feature: Code that depends on the return types might have different semantics in this revision of C++. Translation units compiled against this version of C++ may be incompatible with translation units compiled against C++ 2017, either failing to link or having undefined behavior.
// C.2.12 Clause 25: iterators library [diff.cpp17.iterators]
//  Affected subclause: 25.3.2.3
// Change: The specialization of iterator_traits for void* and for function pointer types no longer contains any nested typedefs.
// Rationale: Corrects an issue misidentifying pointer types that are not incrementable as iterator types. Effect on original feature: A valid C++ 2017 program that relies on the presence of the typedefs may fail to compile, or have different behavior.
// C.2.11 Clause 24: containers library [diff.cpp17.containers]
// C.2.13 Clause 27: algorithms library [diff.cpp17.alg.reqs]
//  Affected subclause: 27.2
// Change: The number and order of deducible template parameters for algorithm declarations is now unspecified, instead of being as-declared.
// Rationale: Increase implementor freedom and allow some function templates to be implemented as function objects with templated call operators.
// Effect on original feature: A valid C++ 2017 program that passes explicit template arguments to algorithms not explicitly specified to allow such in this version of C++ may fail to compile or have undefined behavior.
// C.2.14 Clause 31: input/output library [diff.cpp17.input.output]
//  Affected subclause: 31.7.4.3.3
// Change: Character array extraction only takes array types.
// Rationale: Increase safety via preventing buffer overflow at compile time.
// Effect on original feature: Valid C++ 2017 code may fail to compile in this revision of C++:
    auto p = new char[100];
    char q[100];
    std::cin >> std::setw(20) >> p; // ill-formed; previously well-formed std::cin >> std::setw(20) >> q; // OK
// Affected subclause: 31.7.5.3.4
// Change: Overload resolution for ostream inserters used with UTF-8 literals.
// Rationale: Required for new features.
// Effect on original feature: Valid C++ 2017 code that passes UTF-8 literals to basic_ostream<char, ...>::operator<< or basic_ostream<wchar_t, ...>::operator<< is now ill-formed.
    std::cout << u8"text"; // previously called operator<<(const char*) and printed a string; // now ill-formed
    std::cout << u8'X'; // previously called operator<<(char) and printed a character; // now ill-formed
//  Affected subclause: 31.7.5.3.4
// Change: Overload resolution for ostream inserters used with wchar_t, char16_t, or char32_t types. Rationale: Removal of surprising behavior.
// Effect on original feature: Valid C++ 2017 code that passes wchar_t, char16_t, or char32_t characters or strings to basic_ostream<char, ...>::operator<< or that passes char16_t or char32_t characters or strings to basic_ostream<wchar_t, ...>::operator<< is now ill-formed.
    std::cout << u"text"; // previously formatted the string as a pointer value; // now ill-formed
    std::cout << u'X'; // previously formatted the character as an integer value; // now ill-formed
//  Affected subclause: 31.12.6
// Change: Return type of filesystem path format observer member functions.
// Rationale: Required for new features.
// Effect on original feature: Valid C++ 2017 code that depends on the u8string() and generic_u8string() member functions of std::filesystem::path returning std::string is not valid in this revision of C++.
    std::filesystem::path p;
    std::string s1 = p.u8string(); // ill-formed; previously well-formed std::string s2 = p.generic_u8string(); // ill-formed; previously well-formed
// C.2.15 Annex D: compatibility features [diff.cpp17.depr]
// Change: Remove uncaught_exception.
// Rationale: The function did not have a clear specification when multiple exceptions were active, and has been superseded by uncaught_exceptions.
// Effect on original feature: A valid C++ 2017 program that calls std::uncaught_exception may fail to compile. It can be revised to use std::uncaught_exceptions instead, for clear and portable semantics.
//  Change: Remove support for adaptable function API.
// Rationale: The deprecated support relied on a limited convention that could not be extended to support the general case or new language features. It has been superseded by direct language support with decltype, and by the std::bind and std::not_fn function templates.
// Effect on original feature: A valid C++ 2017 program that relies on the presence of result_type, argument_type, first_argument_type, or second_argument_type in a standard library class may fail to compile. A valid C++ 2017 program that calls not1 or not2, or uses the class templates unary_negate or binary_negate, may fail to compile.
//  Change: Remove redundant members from std::allocator.
// Rationale: std::allocator was overspecified, encouraging direct usage in user containers rather than relying on std::allocator_traits, leading to poor containers.
// Effect on original feature: A valid C++ 2017 program that directly makes use of the pointer, const_- pointer, reference, const_reference, rebind, address, construct, destroy, or max_size members of std::allocator, or that directly calls allocate with an additional hint argument, may fail to compile.
//  Change: Remove raw_storage_iterator.
// Rationale: The iterator encouraged use of algorithms that might throw exceptions, but did not return the number of elements successfully constructed that might need to be destroyed in order to avoid leaks. Effect on original feature: A valid C++ 2017 program that uses this iterator class may fail to compile.
//  Change: Remove temporary buffers API.
// Rationale: The temporary buffer facility was intended to provide an efficient optimization for small memory requests, but there is little evidence this was achieved in practice, while requiring the user to provide their own exception-safe wrappers to guard use of the facility in many cases.
// Effect on original feature: A valid C++ 2017 program that calls get_temporary_buffer or return_- temporary_buffer may fail to compile.
//  Change: Remove shared_ptr::unique.
// Rationale: The result of a call to this member function is not reliable in the presence of multiple threads and weak pointers. The member function use_count is similarly unreliable, but has a clearer contract in such cases, and remains available for well defined use in single-threaded cases.
// Effect on original feature: A valid C++ 2017 program that calls unique on a shared_ptr object may fail to compile.
//  Affected subclause: D.15
// Change: Remove deprecated type traits.
// Rationale: The traits had unreliable or awkward interfaces. The is_literal_type trait provided no way to detect which subset of constructors and member functions of a type were declared constexpr. The result_of trait had a surprising syntax that could not report the result of a regular function type. It has been superseded by the invoke_result trait.
// Effect on original feature: A valid C++ 2017 program that relies on the is_literal_type or result_of type traits, on the is_literal_type_v variable template, or on the result_of_t alias template may fail to compile.
// C.3 C++ and ISO C++ 2014 [diff.cpp14]
// C.3.1 General [diff.cpp14.general]
//  Subclause C.3 lists the differences between C++ and ISO C++ 2014 (ISO/IEC 14882:2014, Programming Languages — C++), in addition to those listed above, by the chapters of this document.
// C.3.2 Clause 5: lexical conventions [diff.cpp14.lex]
// Affected subclause: 5.2
// Change: Removal of trigraph support as a required feature.
// Rationale: Prevents accidental uses of trigraphs in non-raw string literals and comments.
// Effect on original feature: Valid C++ 2014 code that uses trigraphs may not be valid or may have different semantics in this revision of C++. Implementations may choose to translate trigraphs as specified in C++ 2014 if they appear outside of a raw string literal, as part of the implementation-defined mapping from physical source file characters to the translation character set.
//  Affected subclause: 5.9
// Change: pp-number can contain p sign and P sign.
// Rationale: Necessary to enable hexadecimal-floating-point-literals.
// Effect on original feature: Valid C++ 2014 code may fail to compile or produce different results in this revision of C++. Specifically, character sequences like 0p+0 and 0e1_p+0 are three separate tokens each in C++ 2014, but one single token in this revision of C++. For example:
#define F(a) b ## a
    int b0p = F(0p+0); // ill-formed; equivalent to “
    int b0p = b0p + 0; // ” in C++ 2014
// C.3.3 Clause 7: expressions [diff.cpp14.expr]
//  Affected subclauses: 7.6.1.6 and 7.6.2.3
// Change: Remove increment operator with bool operand.
// Rationale: Obsolete feature with occasionally surprising semantics.
// Effect on original feature: A valid C++ 2014 expression utilizing the increment operator on a bool lvalue is ill-formed in this revision of C++. Note that this might occur when the lvalue has a type given by a template parameter.
//  Affected subclauses: 7.6.2.8 and 7.6.2.9
// Change: Dynamic allocation mechanism for over-aligned types.
// Rationale: Simplify use of over-aligned types.
// Effect on original feature: In C++ 2014 code that uses a new-expression to allocate an object with an over- aligned class type, where that class has no allocation functions of its own, ::operator new(std::size_t) is used to allocate the memory. In this revision of C++, ::operator new(std::size_t, std::align_val_t) is used instead.
// C.3.4 Clause 9: declarations [diff.cpp14.dcl.dcl]
//  Affected subclause: 9.2.2
// Change: Removal of register storage-class-specifier.
// Rationale: Enable repurposing of deprecated keyword in future revisions of C++.
// Effect on original feature: A valid C++ 2014 declaration utilizing the register storage-class-specifier is ill-formed in this revision of C++. The specifier can simply be removed to retain the original meaning.
//  Affected subclause: 9.2.9.6
// Change: auto deduction from braced-init-list.
// Rationale: More intuitive deduction behavior.
// Effect on original feature: Valid C++ 2014 code may fail to compile or may change meaning in this revision of C++. For example:
    auto x1 {
        1
    }; // was std::initializer_list<int>, now int
    auto x2 {
        1, 2
    }; // was std::initializer_list<int>, now ill-formed
//  Affected subclause: 9.3.4.6
// Change: Make exception specifications be part of the type system.
// Rationale: Improve type-safety.
// Effect on original feature: Valid C++ 2014 code may fail to compile or change meaning in this revision of C++. For example:
    void g1() noexcept;
    void g2();
    template<class T> int f(T *, T *);
    int x = f(g1, g2); // ill-formed; previously well-formed
//  Affected subclause: 9.4.2
// Change: Definition of an aggregate is extended to apply to user-defined types with base classes. Rationale: To increase convenience of aggregate initialization.
// Effect on original feature: Valid C++ 2014 code may fail to compile or produce different results in this revision of C++; initialization from an empty initializer list will perform aggregate initialization instead of invoking a default constructor for the affected types. For example:
            struct derived;
    struct base {
        friend struct derived;
private:
        base(); };
    struct derived : base {};
    derived d1{};
    derived d2;
// error; the code was well-formed in C++ 2014 // still OK
// C.3.5 Clause 11: classes [diff.cpp14.class]
//  Affected subclause: 11.9.4
// Change: Inheriting a constructor no longer injects a constructor into the derived class.
// Rationale: Better interaction with other language features.
// Effect on original feature: Valid C++ 2014 code that uses inheriting constructors may not be valid or may have different semantics. A using-declaration that names a constructor now makes the corresponding base class constructors visible to initializations of the derived class rather than declaring additional derived class constructors.
    struct A {
        template<typename T> A(T, typename T::type = 0);
        A(int);
    };
    struct B : A {
        using A::A;
        B(int); };
    B b(42L);
// now calls B(int), used to call B<long>(long), // which called A(int) due to substitution failure // in A<long>(long).
// C.3.6 Clause 13: templates [diff.cpp14.temp]
//  Affected subclause: 13.10.3.6
// Change: Allowance to deduce from the type of a non-type template argument.
// Rationale: In combination with the ability to declare non-type template arguments with placeholder types, allows partial specializations to decompose from the type deduced for the non-type template argument. Effect on original feature: Valid C++ 2014 code may fail to compile or produce different results in this revision of C++. For example:
    template <int N> struct A;
    template <typename T, T N> int foo(A<N> *) = delete;
            void foo(void *);
    void bar(A<0> *p) {
        foo(p); // ill-formed; previously well-formed }
// C.3.7 Clause 14: exception handling [diff.cpp14.except]
//  Affected subclause: 14.5
// Change: Remove dynamic exception specifications.
// Rationale: Dynamic exception specifications were a deprecated feature that was complex and brittle in use. They interacted badly with the type system, which became a more significant issue in this revision of C++ where (non-dynamic) exception specifications are part of the function type.
// Effect on original feature: A valid C++ 2014 function declaration, member function declaration, function pointer declaration, or function reference declaration, if it has a potentially throwing dynamic exception specification, is rejected as ill-formed in this revision of C++. Violating a non-throwing dynamic exception specification calls terminate rather than unexpected, and it is unspecified whether stack unwinding is performed prior to such a call.
// C.3.8 Clause 16: library introduction [diff.cpp14.library]
//  Affected subclause: 16.4.2.3
// Change: New headers.
// Rationale: New functionality.
// Effect on original feature: The following C++ headers are new: <any> (22.7.2), <charconv> (22.13.1), <execution> (22.12.2), <filesystem> (31.12.4), <memory_resource> (20.4.1), <optional> (22.5.2), <string_view> (23.3.2), and <variant> (22.6.2). Valid C++ 2014 code that #includes headers with these names may be invalid in this revision of C++.
//  Affected subclause: 16.4.5.2.3
// Change: New reserved namespaces.
// Rationale: Reserve namespaces for future revisions of the standard library that might otherwise be incompatible with existing programs.
// Effect on original feature: The global namespaces std followed by an arbitrary sequence of digits (5.10) are reserved for future standardization. Valid C++ 2014 code that uses such a top-level namespace, e.g., std2, may be invalid in this revision of C++.
// C.3.9 Clause 22: general utilities library [diff.cpp14.utilities]
//  Affected subclause: 22.10.17
// Change: Constructors taking allocators removed.
// Rationale: No implementation consensus.
// Effect on original feature: Valid C++ 2014 code may fail to compile or may change meaning in this revision of C++. Specifically, constructing a std::function with an allocator is ill-formed and uses-allocator construction will not pass an allocator to std::function constructors in this revision of C++.
//  Affected subclause: 20.3.2.2
// Change: Different constraint on conversions from unique_ptr.
// Rationale: Adding array support to shared_ptr, via the syntax shared_ptr<T[]> and shared_ptr<T[N]>. Effect on original feature: Valid C++ 2014 code may fail to compile or may change meaning in this revision of C++. For example:
#include <memory>
        std::unique_ptr<int[]> arr(new int[1]);
        std::shared_ptr<int> ptr(std::move(arr));
// C.3.10 Clause 23: strings library [diff.cpp14.string]
// error: int(*)[] is not compatible with int*
//  Affected subclause: 23.4.3
// Change: Non-const .data() member added.
// Rationale: The lack of a non-const .data() differed from the similar member of std::vector. This change regularizes behavior.
// Effect on original feature: Overloaded functions which have differing code paths for char* and const char* arguments will execute differently when called with a non-const string’s .data() member in this revision of C++.
        int f(char *) = delete;
        int f(const char *);
        string s;
        int x = f(s.data()); // ill-formed; previously well-formed
// C.3.11 Clause 24: containers library [diff.cpp14.containers]
//  Affected subclause: 24.2.7
// Change: Requirements change:
// Rationale: Increase portability, clarification of associative container requirements.
// Effect on original feature: Valid C++ 2014 code that attempts to use associative containers having a comparison object with non-const function call operator may fail to compile in this revision of C++:
#include <set>
        struct compare
        {
            bool operator()(int a, int b)
            {
                return a < b;
            }
        };
        int main() {
            const std::set<int, compare> s;
            s.find(0);
        }
// C.3.12 Annex D: compatibility features [diff.cpp14.depr]
//  Change: The class templates auto_ptr, unary_function, and binary_function, the function templates random_shuffle, and the function templates (and their return types) ptr_fun, mem_fun, mem_fun_ref, bind1st, and bind2nd are not defined.
// Rationale: Superseded by new features.
// Effect on original feature: Valid C++ 2014 code that uses these class templates and function templates may fail to compile in this revision of C++.
//  Change: Remove old iostreams members [depr.ios.members].
// Rationale: Redundant feature for compatibility with pre-standard code has served its time.
// Effect on original feature: A valid C++ 2014 program using these identifiers may be ill-formed in this revision of C++.
// C.4 C++ and ISO C++ 2011 [diff.cpp11]
// C.4.1 General [diff.cpp11.general]
//  Subclause C.4 lists the differences between C++ and ISO C++ 2011 (ISO/IEC 14882:2011, Programming Languages — C++), in addition to those listed above, by the chapters of this document.
// C.4.2 Clause 5: lexical conventions [diff.cpp11.lex]
// Affected subclause: 5.9
// Change: pp-number can contain one or more single quotes.
// Rationale: Necessary to enable single quotes as digit separators.
// Effect on original feature: Valid C++ 2011 code may fail to compile or may change meaning in this revision of C++. For example, the following code is valid both in C++ 2011 and in this revision of C++, but the macro invocation produces different outcomes because the single quotes delimit a character-literal in C++ 2011, whereas they are digit separators in this revision of C++:
#define M(x, ...) __VA_ARGS__
        int x[2] = { M(1'2,3'4, 5) };
//int x[2] = { 5 }; —C++ 2011
// int x[2] = { 3’4, 5 }; — this revision of C++
// C.4.3 Clause 6: basics [diff.cpp11.basic]
//  Affected subclause: 6.7.5.5.3
// Change: New usual (non-placement) deallocator.
// Rationale: Required for sized deallocation.
// Effect on original feature: Valid C++ 2011 code can declare a global placement allocation function and deallocation function as follows:
        void* operator new(std::size_t, std::size_t);
        void operator delete(void*, std::size_t) noexcept;
// In this revision of C++, however, the declaration of operator delete might match a predefined usual (non-placement) operator delete (6.7.5.5). If so, the program is ill-formed, as it was for class member allocation functions and deallocation functions (7.6.2.8).
// C.4.4 Clause 7: expressions [diff.cpp11.expr]
//  Affected subclause: 7.6.16
// Change: A conditional expression with a throw expression as its second or third operand keeps the type and value category of the other operand.
// Rationale: Formerly mandated conversions (lvalue-to-rvalue (7.3.2), array-to-pointer (7.3.3), and function- to-pointer (7.3.4) standard conversions), especially the creation of the temporary due to lvalue-to-rvalue conversion, were considered gratuitous and surprising.
// Effect on original feature: Valid C++ 2011 code that relies on the conversions may behave differently in this revision of C++:
        struct S {
            int x = 1;
            void mf() {
                x = 2;
            }
        };
        int f(bool cond) {
            S s;
            (cond ? s : throw 0).mf();
            return s.x;
        }
// In C++ 2011, f(true) returns 1. In this revision of C++, it returns 2. sizeof(true ? "" : throw 0)
// In C++ 2011, the expression yields sizeof(const char*). In this revision of C++, it yields sizeof(const char[1]).
// C.4.5 Clause 9: declarations [diff.cpp11.dcl.dcl]
//  Affected subclause: 9.2.6
// Change: constexpr non-static member functions are not implicitly const member functions.
// Rationale: Necessary to allow constexpr member functions to mutate the object.
// Effect on original feature: Valid C++ 2011 code may fail to compile in this revision of C++. For example, the following code is valid in C++ 2011 but invalid in this revision of C++ because it declares the same member function twice with different return types:
        struct S {
            constexpr const int &f();
            int &f();
        };
//  Affected subclause: 9.4.2
// Change: Classes with default member initializers can be aggregates.
// Rationale: Necessary to allow default member initializers to be used by aggregate initialization.
// Effect on original feature: Valid C++ 2011 code may fail to compile or may change meaning in this revision of C++. For example:
        struct S {
            int m = 1;
        };
        struct X {
            operator int();
            operator S();
        };
        X a{};
        S b{a};
// Aggregate in C++ 2014 onwards.
// uses copy constructor in C++ 2011,
// performs aggregate initialization in this revision of C++
// C.4.6 Clause 16: library introduction [diff.cpp11.library]
//  Affected subclause: 16.4.2.3
// Change: New header.
// Rationale: New functionality.
// Effect on original feature: The C++ header <shared_mutex> (33.6.3) is new. Valid C++ 2011 code that #includes a header with that name may be invalid in this revision of C++.
// C.4.7 Clause 31: input/output library [diff.cpp11.input.output]
//  Affected subclause: 31.13
// Change: gets is not defined.
// Rationale: Use of gets is considered dangerous.
// Effect on original feature: Valid C++ 2011 code that uses the gets function may fail to compile in this revision of C++.
// C.5 C++ and ISO C++ 2003 [diff.cpp03]
// C.5.1 General [diff.cpp03.general]
//  Subclause C.5 lists the differences between C++ and ISO C++ 2003 (ISO/IEC 14882:2003, Programming Languages — C++), in addition to those listed above, by the chapters of this document.
// C.5.2 Clause 5: lexical conventions [diff.cpp03.lex]
//  Affected subclause: 5.4
// Change: New kinds of string-literals.
// Rationale: Required for new features.
// Effect on original feature: Valid C++ 2003 code may fail to compile or produce different results in this revision of C++. Specifically, macros named R, u8, u8R, u, uR, U, UR, or LR will not be expanded when adjacent to a string-literal but will be interpreted as part of the string-literal. For example:
#define u8 "abc"
        const char* s = u8"def"; // Previously "abcdef", now "def"
//  Affected subclause: 5.4
// Change: User-defined literal string support.
// Rationale: Required for new features.
// Effect on original feature: Valid C++ 2003 code may fail to compile or produce different results in this revision of C++. For example:
#define _x "there" "hello"_x // #1
// Previously, #1 would have consisted of two separate preprocessing tokens and the macro _x would have been expanded. In this revision of C++, #1 consists of a single preprocessing token, so the macro is not expanded.
//  Affected subclause: 5.11
// Change: New keywords.
// Rationale: Required for new features.
// Effect on original feature: Added to Table 5, the following identifiers are new keywords: alignas, alignof, char16_t, char32_t, constexpr, decltype, noexcept, nullptr, static_assert, and thread_local. Valid C++ 2003 code using these identifiers is invalid in this revision of C++.
//  Affected subclause: 5.13.2
// Change: Type of integer literals.
// Rationale: C99 compatibility.
// Effect on original feature: Certain integer literals larger than can be represented by long could change from an unsigned integer type to signed long long.
// C.5.3 Clause 7: expressions [diff.cpp03.expr]
//  Affected subclause: 7.3.12
// Change: Only literals are integer null pointer constants.
// Rationale: Removing surprising interactions with templates and constant expressions.
// Effect on original feature: Valid C++ 2003 code may fail to compile or produce different results in this revision of C++. For example:
        void f(void *); // #1
        void f(...); // #2
        template<int N> void g() {
            f(0*N); // calls #2; used to call #1
        }
//  Affected subclause: 7.6.5
// Change: Specify rounding for results of integer / and %.
// Rationale: Increase portability, C99 compatibility.
// Effect on original feature: Valid C++ 2003 code that uses integer division rounds the result toward 0 or toward negative infinity, whereas this revision of C++ always rounds the result toward 0.
//  Affected subclause: 7.6.14
// Change: && is valid in a type-name.
// Rationale: Required for new features.
// Effect on original feature: Valid C++ 2003 code may fail to compile or produce different results in this revision of C++. For example:
        bool b1 = new int && false;
        struct S {
            operator int();
        };
        bool b2 = &S::operator int && false;
// C.5.4 Clause 9: declarations [diff.cpp03.dcl.dcl]
// previously false, now ill-formed // previously false, now ill-formed
//  Affected subclause: 9.2
// Change: Remove auto as a storage class specifier.
// Rationale: New feature.
// Effect on original feature: Valid C++ 2003 code that uses the keyword auto as a storage class specifier may be invalid in this revision of C++. In this revision of C++, auto indicates that the type of a variable is to be deduced from its initializer expression.
//  Affected subclause: 9.4.5
// Change: Narrowing restrictions in aggregate initializers.
// Rationale: Catches bugs.
// Effect on original feature: Valid C++ 2003 code may fail to compile in this revision of C++. For example, the following code is valid in C++ 2003 but invalid in this revision of C++ because double to int is a narrowing conversion:
        int x[] = { 2.0 };
// C.5.5 Clause 11: classes [diff.cpp03.class]
//  Affected subclauses: 11.4.5.2, 11.4.7, 11.4.5.3, and 11.4.6
// Change: Implicitly-declared special member functions are defined as deleted when the implicit definition would have been ill-formed.
// Rationale: Improves template argument deduction failure.
// Effect on original feature: A valid C++ 2003 program that uses one of these special member functions in a context where the definition is not required (e.g., in an expression that is not potentially evaluated) becomes ill-formed.
// Affected subclause: 11.4.7
// Change: User-declared destructors have an implicit exception specification.
// Rationale: Clarification of destructor requirements.
// Effect on original feature: Valid C++ 2003 code may execute differently in this revision of C++. In particular, destructors that throw exceptions will call std::terminate (without calling std::unexpected) if their exception specification is non-throwing.
// C.5.6 Clause 13: templates [diff.cpp03.temp]
//  Affected subclause: 13.2
// Change: Repurpose export for modules (Clause 10, 15.4, 15.5).
// Rationale: No implementation consensus for the C++ 2003 meaning of export.
// Effect on original feature: A valid C++ 2003 program containing export is ill-formed in this revision of C++.
//  Affected subclause: 13.4
// Change: Remove whitespace requirement for nested closing template right angle brackets.
// Rationale: Considered a persistent but minor annoyance. Template aliases representing non-class types would exacerbate whitespace issues.
// Effect on original feature: Change to semantics of well-defined expression. A valid C++ 2003 expression containing a right angle bracket (“>”) followed immediately by another right angle bracket may now be treated as closing two templates. For example, the following code is valid in C++ 2003 because “>>” is a right-shift operator, but invalid in this revision of C++ because “>>” closes two templates.
        template <class T> struct X { };
        template <int N> struct Y { };
        X< Y< 1 >> 2 > > x;
//  Affected subclause: 13.8.4.2
// Change: Allow dependent calls of functions with internal linkage.
// Rationale: Overly constrained, simplify overload resolution rules.
// Effect on original feature: A valid C++ 2003 program could get a different result than in this revision of C++.
// C.5.7 Clause 16: library introduction [diff.cpp03.library]
//  Affected: Clause 16 – Clause 33
// Change: New reserved identifiers.
// Rationale: Required by new features.
// Effect on original feature: Valid C++ 2003 code that uses any identifiers added to the C++ standard library by later revisions of C++ may fail to compile or produce different results in this revision of C++. A comprehensive list of identifiers used by the C++ standard library can be found in the Index of Library Names in this document.
//  Affected subclause: 16.4.2.3
// Change: New headers.
// Rationale: New functionality.
// Effect on original feature: The following C++ headers are new: <array> (24.3.2), <atomic> (33.5.2), <chrono> (29.2), <codecvt> (D.22.2), <condition_variable> (33.7.2), <forward_list> (24.3.4), <future> (33.10.2), <initializer_list> (17.10.2), <mutex> (33.6.2), <random> (28.5.2), <ratio> (21.4.2), <regex> (32.3), <scoped_allocator> (20.5.1), <system_error> (19.5.2), <thread> (33.4.2), <tuple> (22.4.2), <type- index> (22.11.1), <type_traits> (21.3.3), <unordered_map> (24.5.2), and <unordered_set> (24.5.3). In addition the following C compatibility headers are new: <cfenv> (28.3.1), <cinttypes> (31.13.2), <cstdint> (17.4.2), and <cuchar> (23.5.5). Valid C++ 2003 code that #includes headers with these names may be invalid in this revision of C++.
//  Affected subclause: 16.4.4.3
// Effect on original feature: Function swap moved to a different header
// Rationale: Remove dependency on <algorithm> (27.4) for swap.
// Effect on original feature: Valid C++ 2003 code that has been compiled expecting swap to be in <algorithm> (27.4) may have to instead include <utility> (22.2.1).
//  Affected subclause: 16.4.5.2.2
// Change: New reserved namespace.
// Rationale: New functionality.
// Effect on original feature: The global namespace posix is now reserved for standardization. Valid C++ 2003 code that uses a top-level namespace posix may be invalid in this revision of C++.
//  Affected subclause: 16.4.6.3
// Change: Additional restrictions on macro names.
// Rationale: Avoid hard to diagnose or non-portable constructs.
// Effect on original feature: Names of attribute identifiers may not be used as macro names. Valid C++ 2003 code that defines override, final, carries_dependency, or noreturn as macros is invalid in this revision of C++.
// C.5.8 Clause 17: language support library [diff.cpp03.language.support]
//  Affected subclause: 17.6.3.2
// Change: operator new may throw exceptions other than std::bad_alloc.
// Rationale: Consistent application of noexcept.
// Effect on original feature: Valid C++ 2003 code that assumes that global operator new only throws std::bad_alloc may execute differently in this revision of C++. Valid C++ 2003 code that replaces the global replaceable operator new is ill-formed in this revision of C++, because the exception specification of throw(std::bad_alloc) was removed.
// C.5.9 Clause 19: diagnostics library [diff.cpp03.diagnostics]
//  Affected subclause: 19.4
// Change: Thread-local error numbers.
// Rationale: Support for new thread facilities.
// Effect on original feature: Valid but implementation-specific C++ 2003 code that relies on errno being the same across threads may change behavior in this revision of C++.
// C.5.10 Clause 22: general utilities library [diff.cpp03.utilities]
//  Affected subclauses: 22.10.6, 22.10.7, 22.10.8, 22.10.10, and 22.10.11
// Change: Standard function object types no longer derived from std::unary_function or std::binary_- function.
// Rationale: Superseded by new feature; unary_function and binary_function are no longer defined. Effect on original feature: Valid C++ 2003 code that depends on function object types being derived from unary_function or binary_function may fail to compile in this revision of C++.
// C.5.11 Clause 23: strings library [diff.cpp03.strings]
//  Affected subclause: 23.4
// Change: basic_string requirements no longer allow reference-counted strings.
// Rationale: Invalidation is subtly different with reference-counted strings. This change regularizes behavior. Effect on original feature: Valid C++ 2003 code may execute differently in this revision of C++.
// — not all containers provide size(); use empty() instead of size() == 0; — not all containers are empty after construction (array);
// — not all containers have constant complexity for swap() (array).
//  Affected subclause: 23.4.3.2
// Change: Loosen basic_string invalidation rules.
// Rationale: Allow small-string optimization.
// Effect on original feature: Valid C++ 2003 code may execute differently in this revision of C++. Some const member functions, such as data and c_str, no longer invalidate iterators.
// C.5.12 Clause 24: containers library [diff.cpp03.containers]
//  Affected subclause: 24.2
// Change: Complexity of size() member functions now constant.
// Rationale: Lack of specification of complexity of size() resulted in divergent implementations with inconsistent performance characteristics.
// Effect on original feature: Some container implementations that conform to C++ 2003 may not conform to the specified size() requirements in this revision of C++. Adjusting containers such as std::list to the stricter requirements may require incompatible changes.
//  Affected subclause: 24.2
// Change: Requirements change: relaxation.
// Rationale: Clarification.
// Effect on original feature: Valid C++ 2003 code that attempts to meet the specified container requirements may now be over-specified. Code that attempted to be portable across containers may need to be adjusted as follows:
// Affected subclause: 24.2
// Change: Requirements change: default constructible.
// Rationale: Clarification of container requirements.
// Effect on original feature: Valid C++ 2003 code that attempts to explicitly instantiate a container using a user-defined type with no default constructor may fail to compile.
// Affected subclauses: 24.2.4 and 24.2.7
// Change: Signature changes: from void return types.
// Rationale: Old signature threw away useful information that may be expensive to recalculate. Effect on original feature: The following member functions have changed:
// — erase(iter) for set, multiset, map, multimap
// — erase(begin, end) for set, multiset, map, multimap
//— insert(pos, num, val) for vector, deque, list, forward_list — insert(pos, beg, end) for vector, deque, list, forward_list
        (// 4.1) (4.2) (4.3) (4.4)
// Affected subclauses: 24.2.4 and 24.2.7
// Change: Signature changes: from iterator to const_iterator parameters.
// Rationale: Overspecification.
// Effect on original feature: The signatures of the following member functions changed from taking an iterator to taking a const_iterator:
// Valid C++ 2003 code that relies on these functions returning void (e.g., code that creates a pointer to member function that points to one of these functions) will fail to compile with this revision of C++.
// — insert(iter, val) for vector, deque, list, set, multiset, map, multimap — insert(pos, beg, end) for vector, deque, list, forward_list
// — erase(begin, end) for set, multiset, map, multimap
// — all forms of list::splice
//  Affected subclauses: 24.2.4 and 24.2.7
// Change: Signature changes: resize.
// Rationale: Performance, compatibility with move semantics.
// — all forms of list::merge
// Valid C++ 2003 code that uses these functions may fail to compile with this revision of C++.
// — passing a value to a function that takes an argument of type bool; — using operator== to compare to false or true;
// — returning a value from a function with a return type of bool;
// — initializing members of type bool via aggregate initialization;
// — initializing a const bool& which would bind to a temporary
// Effect on original feature: For vector, deque, and list the fill value passed to resize is now passed by reference instead of by value, and an additional overload of resize has been added. Valid C++ 2003 code that uses this function may fail to compile with this revision of C++.
// C.5.13 Clause 27: algorithms library [diff.cpp03.algorithms]
//  Affected subclause: 27.1
// Change: Result state of inputs after application of some algorithms.
// Rationale: Required by new feature.
// Effect on original feature: A valid C++ 2003 program may detect that an object with a valid but unspecified state has a different valid but unspecified state with this revision of C++. For example, std::remove and std::remove_if may leave the tail of the input sequence with a different set of values than previously.
// C.5.14 Clause 28: numerics library [diff.cpp03.numerics]
//  Affected subclause: 28.4
// Change: Specified representation of complex numbers.
// Rationale: Compatibility with C99.
// Effect on original feature: Valid C++ 2003 code that uses implementation-specific knowledge about the binary representation of the required template specializations of std::complex may not be compatible with this revision of C++.
// C.5.15 Clause 30: localization library [diff.cpp03.locale]
//  Affected subclause: 30.4.3.2.3
// Change: The num_get facet recognizes hexadecimal floating point values.
// Rationale: Required by new feature.
// Effect on original feature: Valid C++ 2003 code may have different behavior in this revision of C++.
// C.5.16 Clause 31: input/output library [diff.cpp03.input.output]
//  Affected subclauses: 31.7.4.2.4, 31.7.5.2.4, and 31.5.4.4
// Change: Specify use of explicit in existing boolean conversion functions.
// Rationale: Clarify intentions, avoid workarounds.
// Effect on original feature: Valid C++ 2003 code that relies on implicit boolean conversions will fail to compile with this revision of C++. Such conversions occur in the following conditions:
//  Affected subclause: 31.5.2.2.1
// Change: Change base class of std::ios_base::failure.
// Rationale: More detailed error messages.
// Effect on original feature: std::ios_base::failure is no longer derived directly from std::exception, but is now derived from std::system_error, which in turn is derived from std::runtime_error. Valid C++ 2003 code that assumes that std::ios_base::failure is derived directly from std::exception may execute differently in this revision of C++.
//  Affected subclause: 31.5.2
// Change: Flag types in std::ios_base are now bitmasks with values defined as constexpr static members. Rationale: Required for new features.
// Effect on original feature: Valid C++ 2003 code that relies on std::ios_base flag types being represented as std::bitset or as an integer type may fail to compile with this revision of C++. For example:
#include <iostream>
        int main2() {
            int flag = std::ios_base::hex;
            std::cout.setf(flag); // error: setf does not take argument of type int
        }
// C.6 C++ and ISO C [diff.iso]
// C.6.1 General [diff.iso.general]
//  Subclause C.6 lists the differences between C++ and ISO C, in addition to those listed above, by the chapters of this document.
// C.6.2 Clause 5: lexical conventions [diff.lex]
//  Affected subclause: 5.11
// Change: New Keywords New keywords are added to C++; see 5.11.
// Rationale: These keywords were added in order to implement the new semantics of C++.
// Effect on original feature: Change to semantics of well-defined feature. Any ISO C programs that used any of these keywords as identifiers are not valid C++ programs.
// Difficulty of converting: Syntactic transformation. Converting one specific program is easy. Converting a large collection of related programs takes more work.
// How widely used: Common.
//  Affected subclause: 5.13.3
// Change: Type of character-literal is changed from int to char.
// Rationale: This is needed for improved overloaded function argument type matching. For example:
        int function( int i );
        int function( char c );
        function( 'x' );
// It is preferable that this call match the second version of function rather than the first.
// Effect on original feature: Change to semantics of well-defined feature. ISO C programs which depend on   sizeof('x') == sizeof(int) will not work the same as C++ programs.
// Difficulty of converting: Simple.
// How widely used: Programs which depend upon sizeof(’x’) are probably rare.
//  Affected subclause: 5.13.5
// Change: Concatenated string-literals can no longer have conflicting encoding-prefixes.
// Rationale: Removal of non-portable feature.
// Effect on original feature: Concatenation of string-literals with different encoding-prefixes is now ill-formed. Difficulty of converting: Syntactic transformation.
// How widely used: Seldom.
//  Affected subclause: 5.13.5
// Change: String literals made const.
// The type of a string-literal is changed from “array of char” to “array of const char”. The type of a UTF-8 string literal is changed from “array of char” to “array of const char8_t”. The type of a UTF-16 string literal is changed from “array of some-integer-type” to “array of const char16_t”. The type of a UTF-32 string literal is changed from “array of some-integer-type” to “array of const char32_t”. The type of a wide string literal is changed from “array of wchar_t” to “array of const wchar_t”.
// Rationale: This avoids calling an inappropriate overloaded function, which might expect to be able to modify its argument.
// Effect on original feature: Change to semantics of well-defined feature.
// Difficulty of converting: Syntactic transformation. The fix is to add a cast:
        char* p = "abc";
        void f(char*) {
            char* p = (char*)"abc";
            f(p);
            f((char*)"def");
// valid in C, invalid in C++ // OK, cast added
// OK, cast added
        }
// How widely used: Programs that have a legitimate reason to treat string literal objects as potentially modifiable memory are probably rare.
// C.6.3 Clause 6: basics [diff.basic]
//  Affected subclause: 6.2
// Change: C++ does not have “tentative definitions” as in C. E.g., at file scope,
        int i; int i;
// is valid in C, invalid in C++. This makes it impossible to define mutually referential file-local objects with static storage duration, if initializers are restricted to the syntactic forms of C. For example,
        struct X { int i; struct X* next; };
        static struct X a;
        static struct X b = { 0, &a };
                            static struct X a = { 1, &b };
// Rationale: This avoids having different initialization rules for fundamental types and user-defined types. Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Semantic transformation. In C++, the initializer for one of a set of mutually- referential file-local objects with static storage duration must invoke a function call to achieve the initialization. How widely used: Seldom.
//  Affected subclause: 6.4
// Change: A struct is a scope in C++, not in C. For example,
        struct X {
            struct Y { int a; } b;
        };
        struct Y c;
// is valid in C but not in C++, which would require X::Y c;.
// Rationale: Class scope is crucial to C++, and a struct is a class.
// Effect on original feature: Change to semantics of well-defined feature.
// Difficulty of converting: Semantic transformation.
// How widely used: C programs use struct extremely frequently, but the change is only noticeable when struct, enumeration, or enumerator names are referred to outside the struct. The latter is probably rare.
//  Affected subclause: 6.6 [also 9.2.9]
// Change: A name of file scope that is explicitly declared const, and not explicitly declared extern, has internal linkage, while in C it would have external linkage.
// Rationale: Because const objects may be used as values during translation in C++, this feature urges programmers to provide an explicit initializer for each const object. This feature allows the user to put const objects in source files that are included in more than one translation unit.
// Effect on original feature: Change to semantics of well-defined feature.
// Difficulty of converting: Semantic transformation.
// How widely used: Seldom.
// Affected subclause: 6.9.3.1
// Change: The main function cannot be called recursively and cannot have its address taken. Rationale: The main function may require special actions.
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Trivial: create an intermediary function such as mymain(argc, argv). How widely used: Seldom.
//  Affected subclause: 6.8
// Change: C allows “compatible types” in several places, C++ does not.
// For example, otherwise-identical struct types with different tag names are “compatible” in C but are distinctly different types in C++.
// Rationale: Stricter type checking is essential for C++.
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Semantic transformation. The “typesafe linkage” mechanism will find many, but not all, of such problems. Those problems not found by typesafe linkage will continue to function properly, according to the “layout compatibility rules” of this document.
// How widely used: Common.
// C.6.4 Clause 7: expressions [diff.expr]
//  Affected subclause: 7.3.12
// Change: Converting void* to a pointer-to-object type requires casting.
        char a[10];
        void* b=a;
        void foo() {
            char* c=b;
        }
// ISO C accepts this usage of pointer to void being assigned to a pointer to object type. C++ does not. Rationale: C++ tries harder than C to enforce compile-time type safety.
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Can be automated. Violations will be diagnosed by the C++ translator. The fix is to add a cast. For example:
        char* c = (char*) b;
// How widely used: This is fairly widely used but it is good programming practice to add the cast when assigning pointer-to-void to pointer-to-object. Some ISO C translators will give a warning if the cast is not used.
//  Affected subclause: 7.6.1.3
// Change: Implicit declaration of functions is not allowed.
// Rationale: The type-safe nature of C++.
// Effect on original feature: Deletion of semantically well-defined feature. Note: the original feature was labeled as “obsolescent” in ISO C.
// Difficulty of converting: Syntactic transformation. Facilities for producing explicit function declarations are fairly widespread commercially.
// How widely used: Common.
//  Affected subclauses: 7.6.1.6 and 7.6.2.3
// Change: Decrement operator is not allowed with bool operand.
// Rationale: Feature with surprising semantics.
// Effect on original feature: A valid ISO C expression utilizing the decrement operator on a bool lvalue (for instance, via the C typedef in <stdbool.h> (17.14.5)) is ill-formed in C++.
//  Affected subclauses: 7.6.2.5 and 7.6.3
// Change: In C++, types can only be defined in declarations, not in expressions.
// In C, a sizeof expression or cast expression may define a new type. For example,
                  p = (void*)(struct x {int i;} *)0;
// defines a new type, struct x.
// Rationale: This prohibition helps to clarify the location of definitions in the source code. Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Syntactic transformation.
// How widely used: Seldom.
//  Affected subclauses: 7.6.16, 7.6.19, and 7.6.20
// Change: The result of a conditional expression, an assignment expression, or a comma expression may be an lvalue.
// Rationale: C++ is an object-oriented language, placing relatively more emphasis on lvalues. For example, function calls may yield lvalues.
// Effect on original feature: Change to semantics of well-defined feature. Some C expressions that implicitly rely on lvalue-to-rvalue conversions will yield different results. For example,
                  char arr[100];
                  sizeof(0, arr)
// yields 100 in C++ and sizeof(char*) in C.
// Difficulty of converting: Programs must add explicit casts to the appropriate rvalue. How widely used: Rare.
// C.6.5 Clause 8: statements [diff.stat]
//  Affected subclauses: 8.5.3 and 8.7.6
// Change: It is now invalid to jump past a declaration with explicit or implicit initializer (except across entire  block not entered).
// Rationale: Constructors used in initializers may allocate resources which need to be de-allocated upon leaving the block. Allowing jump past initializers would require complicated runtime determination of allocation. Furthermore, any use of the uninitialized object could be a disaster. With this simple compile-time rule, C++ assures that if an initialized variable is in scope, then it has assuredly been initialized.
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Semantic transformation.
// How widely used: Seldom.
//  Affected subclause: 8.7.4
// Change: It is now invalid to return (explicitly or implicitly) from a function which is declared to return a value without actually returning a value.
// Rationale: The caller and callee may assume fairly elaborate return-value mechanisms for the return of class objects. If some flow paths execute a return without specifying any value, the implementation must embody many more complications. Besides, promising to return a value of a given type, and then not returning such a value, has always been recognized to be a questionable practice, tolerated only because very-old C had no distinction between functions with void and int return types.
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Semantic transformation. Add an appropriate return value to the source code, such as zero.
// How widely used: Seldom. For several years, many existing C implementations have produced warnings in this case.
// C.6.6 Clause 9: declarations [diff.dcl]
//  Affected subclause: 9.2.2
// Change: In C++, the static or extern specifiers can only be applied to names of objects or functions. Using these specifiers with type declarations is illegal in C++. In C, these specifiers are ignored when used on type declarations.
// Example:
        static struct S { // valid C, invalid in C++ int i;
        };
// Rationale: Storage class specifiers don’t have any meaning when associated with a type. In C++, class members can be declared with the static storage class specifier. Allowing storage class specifiers on type declarations could render the code confusing for users.
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Syntactic transformation. How widely used: Seldom.
//  Affected subclause: 9.2.2
// Change: In C++, register is not a storage class specifier.
// Rationale: The storage class specifier had no effect in C++.
// Effect on original feature: Deletion of semantically well-defined feature. Difficulty of converting: Syntactic transformation.
// How widely used: Common.
//  Affected subclause: 9.2.4
// Change: A C++ typedef-name must be different from any class type name declared in the same scope (except if the typedef is a synonym of the class name with the same name). In C, a typedef-name and a struct tag name declared in the same scope can have the same name (because they have different name spaces).
// Example:
        typedef struct name1 { /* ... */ } name1; // valid C and C++ struct name { /* ... */ };
        typedef int name; // valid C, invalid C++
// Rationale: For ease of use, C++ doesn’t require that a type name be prefixed with the keywords class, struct or union when used in object declarations or type casts.
// Example:
        class name { /* ... */ };
        name i; // i has type class name
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Semantic transformation. One of the 2 types has to be renamed. How widely used: Seldom.
//  Affected subclause: 9.2.9 [see also 6.6]
// Change: Const objects must be initialized in C++ but can be left uninitialized in C. Rationale: A const object cannot be assigned to so it must be initialized to hold a useful value.
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Semantic transformation.
// How widely used: Seldom.
//  Affected subclause: 9.2.9 Change: Banning implicit int.
// In C++ a decl-specifier-seq must contain a type-specifier, unless it is followed by a declarator for a constructor, a destructor, or a conversion function. In the following example, the left-hand column presents valid C; the right-hand column presents equivalent C++:
        void f(const parm);
        const n = 3;
        main3() {};
        /* ... */
        void f(const int parm);
        const int n = 3;
        int main4() {};
        /* ... */
// Rationale: In C++, implicit int creates several opportunities for ambiguity between expressions involving function-like casts and declarations. Explicit declaration is increasingly considered to be proper style. Liaison with WG14 (C) indicated support for (at least) deprecating implicit int in the next revision of C.
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Syntactic transformation. Can be automated. How widely used: Common.
//  Affected subclause: 9.2.9.6
// Change: The keyword auto cannot be used as a storage class specifier.
        void f() {
            auto int x; // valid C, invalid C++
        }
// Rationale: Allowing the use of auto to deduce the type of a variable from its initializer results in undesired interpretations of auto as a storage class specifier in certain contexts.
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Syntactic transformation.
// How widely used: Rare.
// Affected subclause: 9.3.4.6
// Change: In C++, a function declared with an empty parameter list takes no arguments. In C, an empty parameter list means that the number and type of the function arguments are unknown.
// Example:
        int f(); // means int f(void) in C++ // int f( unknown ) in C
// Rationale: This is to avoid erroneous function calls (i.e., function calls with the wrong number or type of arguments).
// Effect on original feature: Change to semantics of well-defined feature. This feature was marked as
// “obsolescent” in C.
// Difficulty of converting: Syntactic transformation. The function declarations using C incomplete declaration style must be completed to become full prototype declarations. A program may need to be updated further if different calls to the same (non-prototype) function have different numbers of arguments or if the type of corresponding arguments differed.
// How widely used: Common.
//  Affected subclause: 9.3.4.6 [see 7.6.2.5]
// Change: In C++, types may not be defined in return or parameter types. In C, these type definitions are allowed.
// Example:
        void f( struct S { int a; }
//	       	arg ) {}
                enum E { A, B, C };
        f() {};
//validC,invalidC++ //validC,invalidC++
// Rationale: When comparing types in different translation units, C++ relies on name equivalence when C relies on structural equivalence. Regarding parameter types: since the type defined in a parameter list would be in the scope of the function, the only legal calls in C++ would be from within the function itself.
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Semantic transformation. The type definitions must be moved to file scope, or in header files.
// How widely used: Seldom. This style of type definition is seen as poor coding style.
// Affected subclause: 9.5
// Change: In C++, the syntax for function definition excludes the “old-style” C function. In C, “old-style” syntax is allowed, but deprecated as “obsolescent”.
// Rationale: Prototypes are essential to type safety.
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Syntactic transformation.
// How widely used: Common in old programs, but already known to be obsolescent.
//  Affected subclause: 9.4.2
// Change: In C++, designated initialization support is restricted compared to the corresponding functionality in C. In C++, designators for non-static data members must be specified in declaration order, designators for array elements and nested designators are not supported, and designated and non-designated initializers cannot be mixed in the same initializer list.
// Example:
        struct A { int x, y; };
        struct B { struct A a; };
        struct A a = {.y = 1, .x = 2}; //validC,invalidC++
                     int arr[3] = {[1] = 5};
                     struct B b = {.a.x = 0};
                     struct A c = {.x = 1, 2};
// valid C, invalid C++ // valid C, invalid C++ // valid C, invalid C++
// Rationale: In C++, members are destroyed in reverse construction order and the elements of an initializer list are evaluated in lexical order, so field initializers must be specified in order. Array designators conflict with lambda-expression syntax. Nested designators are seldom used.
// Effect on original feature: Deletion of feature that is incompatible with C++.
// Difficulty of converting: Syntactic transformation.
// How widely used: Out-of-order initializers are common. The other features are seldom used.
//  Affected subclause: 9.4.3
// Change: In C++, when initializing an array of character with a string, the number of characters in the string (including the terminating ’\0’) must not exceed the number of elements in the array. In C, an array can be initialized with a string even if the array is not large enough to contain the string-terminating ’\0’.
// Example:
                     char array[4] = "abcd"; // valid C, invalid C++
// Rationale: When these non-terminated arrays are manipulated by standard string functions, there is potential for major catastrophe.
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Semantic transformation. The arrays must be declared one element bigger to contain the string terminating ’\0’.
// How widely used: Seldom. This style of array initialization is seen as poor coding style.
//  Affected subclause: 9.7.1
// Change: C++ objects of enumeration type can only be assigned values of the same enumeration type. In C, objects of enumeration type can be assigned values of any integral type.
// Example:
                     enum color { red, blue, green };
                     enum color c = 1; // valid C, invalid C++
// Rationale: The type-safe nature of C++.
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Syntactic transformation. (The type error produced by the assignment can be automatically corrected by applying an explicit cast.)
// How widely used: Common.
// Affected subclause: 9.7.1
// Change: In C++, the type of an enumerator is its enumeration. In C, the type of an enumerator is int.
// Example:
                     enum e { A };
                     sizeof(A) == sizeof(int) // in C
                     sizeof(A) == sizeof(e) // in C++
//∗ and sizeof(int) is not necessarily equal to sizeof(e) ∗/
// Rationale: In C++, an enumeration is a distinct type.
// Effect on original feature: Change to semantics of well-defined feature.
// Difficulty of converting: Semantic transformation.
// How widely used: Seldom. The only time this affects existing C code is when the size of an enumerator is taken. Taking the size of an enumerator is not a common C coding practice.
// C.6.7 Clause 11: classes [diff.class]
//  Affected subclause: 11.3 [see also 9.2.4]
// Change: In C++, a class declaration introduces the class name into the scope where it is declared and hides any object, function or other declaration of that name in an enclosing scope. In C, an inner scope declaration of a struct tag name never hides the name of an object or function in an outer scope.
// Example:
                     int x[99];
        void f() {
            struct x {
                int a;
            };
            sizeof(x); //∗ size of the array in C ∗/ /∗ size of the struct in C++ ∗/
        }
// Rationale: This is one of the few incompatibilities between C and C++ that can be attributed to the new C++ name space definition where a name can be declared as a type and as a non-type in a single scope causing the non-type name to hide the type name and requiring that the keywords class, struct, union or enum be used to refer to the type name. This new name space definition provides important notational conveniences to C++ programmers and helps making the use of the user-defined types as similar as possible to the use of fundamental types. The advantages of the new name space definition were judged to outweigh by far the incompatibility with C described above.
// Effect on original feature: Change to semantics of well-defined feature.
// Difficulty of converting: Semantic transformation. If the hidden name that needs to be accessed is at global scope, the :: C++ operator can be used. If the hidden name is at block scope, either the type or the struct tag has to be renamed.
// How widely used: Seldom.
//  Affected subclause: 11.4.5.3 Change: Copying volatile objects.
// The implicitly-declared copy constructor and implicitly-declared copy assignment operator cannot make a copy of a volatile lvalue. For example, the following is valid in ISO C:
        struct X { int i; };
        volatile struct X x1 = {0};
                               struct X x2 = x1; // invalid C++ struct X x3;
                               x3=x1; // also invalid C++
// Rationale: Several alternatives were debated at length. Changing the parameter to volatile const X& would greatly complicate the generation of efficient code for class objects. Discussion of providing two alternative signatures for these implicitly-defined operations raised unanswered concerns about creating ambiguities and complicating the rules that specify the formation of these operators according to the bases and members.
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Semantic transformation. If volatile semantics are required for the copy, a user-declared constructor or assignment must be provided. If non-volatile semantics are required, an explicit const_cast can be used.
// How widely used: Seldom.
//  Affected subclause: 11.4.10
// Change: Bit-fields of type plain int are signed.
// Rationale: Leaving the choice of signedness to implementations could lead to inconsistent definitions of template specializations. For consistency, the implementation freedom was eliminated for non-dependent types, too.
// Effect on original feature: The choice is implementation-defined in C, but not so in C++.
// Difficulty of converting: Syntactic transformation.
// How widely used: Seldom.
//  Affected subclause: 11.4.12
// Change: In C++, the name of a nested class is local to its enclosing class. In C the name of the nested class belongs to the same scope as the name of the outermost enclosing class.
// Example:
        struct X {
            struct Y { /* ... */ } y;
        };
        struct Y yy; // valid C, invalid C++
// Rationale: C++ classes have member functions which require that classes establish scopes. The C rule would leave classes as an incomplete scope mechanism which would prevent C++ programmers from maintaining locality within a class. A coherent set of scope rules for C++ based on the C rule would be very complicated and C++ programmers would be unable to predict reliably the meanings of nontrivial examples involving nested or local functions.
// Effect on original feature: Change to semantics of well-defined feature.
// Difficulty of converting: Semantic transformation. To make the struct type name visible in the scope of the enclosing struct, the struct tag can be declared in the scope of the enclosing struct, before the enclosing struct is defined. // Example:
        struct Y; // struct Y and struct X are at the same scope
        struct X {
            struct Y { /* ... */ } y;
        };
// All the definitions of C struct types enclosed in other struct definitions and accessed outside the scope of the enclosing struct can be exported to the scope of the enclosing struct. Note: this is a consequence of the difference in scope rules, which is documented in 6.4.
// How widely used: Seldom.
//  Affected subclause: 6.5.2
// Change: In C++, a typedef-name may not be redeclared in a class definition after being used in that definition.
// Example:
        typedef int I;
        struct S {
            I i;
            int I; };
// valid C, invalid C++
// Rationale: When classes become complicated, allowing such a redefinition after the type has been used can create confusion for C++ programmers as to what the meaning of I really is.
// Effect on original feature: Deletion of semantically well-defined feature.
// Difficulty of converting: Semantic transformation. Either the type or the struct member has to be renamed.
// How widely used: Seldom.
// C.6.8 Clause 15: preprocessing directives [diff.cpp]
//  Affected subclause: 15.11
// Change: Whether __STDC__ is defined and if so, what its value is, are implementation-defined. Rationale: C++ is not identical to ISO C. Mandating that __STDC__ be defined would require that translators make an incorrect claim. // — strchr — strpbrk — strrchr
// Effect on original feature: Change to semantics of well-defined feature.
// Difficulty of converting: Semantic transformation.
// How widely used: Programs and headers that reference __STDC__ are quite common.
//  Subclause C.7 summarizes the explicit changes in headers, definitions, declarations, or behavior between the C standard library in the C standard and the parts of the C++ standard library that were included from the C standard library.
// C.7.2 Modifications to headers [diff.mods.to.headers]
// For compatibility with the C standard library, the C++ standard library provides the C headers enumerated in 17.14.
//  There are no C++ headers for the C standard library’s headers <stdnoreturn.h> and <threads.h>, nor are these headers from the C standard library headers themselves part of C++.
// The C headers <complex.h> and <tgmath.h> do not contain any of the content from the C standard library and instead merely include other headers from the C++ standard library.
// C.7.3 Modifications to definitions [diff.mods.to.definitions]
// C.7.3.1 Types char16_t and char32_t [diff.char16]
//  The types char16_t and char32_t are distinct types rather than typedefs to existing integral types. The tokens char16_t and char32_t are keywords in C++ (5.11). They do not appear as macro or type names defined in <cuchar> (23.5.5).
// C.7.3.2 Type wchar_t [diff.wchar.t]
//  The type wchar_t is a distinct type rather than a typedef to an existing integral type. The token wchar_t is a keyword in C++ (5.11). It does not appear as a macro or type name defined in any of <cstddef> (17.2.1), <cstdlib> (17.2.2), or <cwchar> (23.5.4).
// C.7.3.3 Header <assert.h> [diff.header.assert.h]
//  The token static_assert is a keyword in C++. It does not appear as a macro name defined in <cassert> (19.3.2).
// C.7.3.4 Header <iso646.h> [diff.header.iso646.h]
//  The tokens and, and_eq, bitand, bitor, compl, not, not_eq, or, or_eq, xor, and xor_eq are keywords in C++ (5.11), and are not introduced as macros by <iso646.h> (17.14.3).
// C.7.3.5 Header <stdalign.h> [diff.header.stdalign.h]
//  The token alignas is a keyword in C++ (5.11), and is not introduced as a macro by <stdalign.h> (17.14.4).
// C.7.3.6 Header <stdbool.h> [diff.header.stdbool.h]
//  The tokens bool, true, and false are keywords in C++ (5.11), and are not introduced as macros by <stdbool.h> (17.14.5).
// C.7.3.7 Macro NULL [diff.null]
//  The macro NULL, defined in any of <clocale> (30.5.1), <cstddef> (17.2.1), <cstdio> (31.13.1), <cstdlib> (17.2.2), <cstring> (23.5.3), <ctime> (29.14), or <cwchar> (23.5.4), is an implementation-defined null pointer constant in C++ (17.2).
// C.7.4 Modifications to declarations [diff.mods.to.declarations]
//  Header <cstring> (23.5.3): The following functions have different declarations:
// [diff.library]
// C.7.1 General [diff.library.general]
// C.7 C standard library
// — atexit — exit — abort — strstr
//  Header <cwchar> (23.5.4): The following functions have different declarations:
// — memchr
// Subclause 23.5.3 describes the changes.
// — wcschr — wcspbrk — wcsrchr — wcsstr — wmemchr
//  Header <cstddef> (17.2.1) declares the names nullptr_t, byte, and to_integer, and the operators and operator templates in (17.2.5), in addition to the names declared in <stddef.h> (17.14) in the C standard library.
// C.7.5 Modifications to behavior [diff.mods.to.behavior]
// C.7.5.1 General [diff.mods.to.behavior.general]
//  Header <cstdlib> (17.2.2): The following functions have different behavior:
// Subclause 23.5.4 describes the changes.
// Subclause 17.5 describes the changes.
//  Header <csetjmp> (17.13.3): The following functions have different behavior:
// — longjmp
// Subclause 17.13.3 describes the changes.
// C.7.5.2 Macro offsetof(type, member-designator)
//  The macro offsetof, defined in <cstddef> (17.2.1), accepts a restricted set of type arguments in C++.
// Subclause 17.2.4 describes the change.
// C.7.5.3 Memory allocation functions [diff.malloc]
//  The functions aligned_alloc, calloc, malloc, and realloc are restricted in C++. Subclause 20.2.11 describes the changes.
        int main() {
            main2();
            main3();
            main4();
            cout  <<  n4910 << endl;
            return EXIT_SUCCESS;
        }

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

bash
$ clang++ p1777.cpp -std=03 -o p1777l -I. -Wall
In file included from p1777.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 \
 ^
p1777.cpp:27:1: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
auto c = L"a" U"b"; // was conditionally-supported; now ill-formed
^
p1777.cpp:27:14: error: expected ';' after top level declarator
auto c = L"a" U"b"; // was conditionally-supported; now ill-formed
             ^
             ;
p1777.cpp:43:1: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
auto s = std::format("{:d}", "I am not a number"); // ill-formed,
^
p1777.cpp:43:15: error: no member named 'format' in namespace 'std'
auto s = std::format("{:d}", "I am not a number"); // ill-formed,
         ~~~~~^
p1777.cpp:52:1: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
auto t = tiny();
^
p1777.cpp:53:6: error: C++ requires a type specifier for all declarations
std::format("{}", t.bit);
     ^
p1777.cpp:53:6: error: no member named 'format' in namespace 'std'
std::format("{}", t.bit);
~~~~~^
p1777.cpp:61:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
    auto operator<=>(const B&) const = default;
    ^
p1777.cpp:61:18: warning: '<=>' is a single token in C++20; add a space to avoid a change in behavior [-Wc++20-compat]
    auto operator<=>(const B&) const = default;
                 ^
                    
p1777.cpp:61:10: error: 'operator<=' cannot be the name of a variable or data member
    auto operator<=>(const B&) const = default;
         ^
p1777.cpp:61:20: error: expected ';' at end of declaration list
    auto operator<=>(const B&) const = default;
                   ^
                   ;
p1777.cpp:64:17: error: no template named 'set' in namespace 'std'
    void f(std::set<B, std::less<>>& s) {
           ~~~~~^
p1777.cpp:64:34: error: a space is required between consecutive right angle brackets (use '> >')
    void f(std::set<B, std::less<>>& s) {
                                 ^~
                                 > >
p1777.cpp:64:29: error: too few template arguments for class template 'less'
    void f(std::set<B, std::less<>>& s) {
                            ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_function.h:381:12: note: template is declared here
    struct less : public binary_function<_Tp, _Tp, bool>
           ^
p1777.cpp:81:3: error: no type named 'import' in the global namespace; did you mean simply 'import'?
  ::import j2;
  ^~~~~~~~
  import
p1777.cpp:79:9: note: 'import' declared here
  class import {};
        ^
p1777.cpp:89:26: error: redefinition of 'import' as different kind of symbol
template<typename> class import {};
                         ^
p1777.cpp:79:9: note: previous definition is here
  class import {};
        ^
p1777.cpp:90:9: error: expected member name or ';' after declaration specifiers
  import<int> f();
  ~~~~~~^
p1777.cpp:91:5: error: no template named 'import' in the global namespace
  ::import<int> g();
  ~~^
p1777.cpp:63:10: error: missing '}' at end of definition of 'D'
  struct D : private B {
         ^
p1777.cpp:105:1: note: still within definition of 'D' here
namespace N {
^
p1777.cpp:109:11: warning: '<=>' is a single token in C++20; add a space to avoid a change in behavior [-Wc++20-compat]
Y<operator<=> y; // ill-formed; previously well-formed
          ^
             
p1777.cpp:116:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
  const auto *u8s = u8"text";
        ^
p1777.cpp:116:21: error: use of undeclared identifier 'u8'
  const auto *u8s = u8"text";
                    ^
p1777.cpp:116:23: error: expected ';' after top level declarator
  const auto *u8s = u8"text";
                      ^
                      ;
p1777.cpp:118:3: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
  auto u8c = u8'c';
  ^
p1777.cpp:118:14: error: use of undeclared identifier 'u8'
  auto u8c = u8'c';
             ^
p1777.cpp:118:16: error: expected ';' after top level declarator
  auto u8c = u8'c';
               ^
               ;
fatal error: too many errors emitted, stopping now [-ferror-limit=]
8 warnings and 20 errors generated.
$ clang++ p1777.cpp -std=2b -o p1777l -I. -Wall
p1777.cpp:27:15: error: unsupported non-standard concatenation of string literals
auto c = L"a" U"b"; // was conditionally-supported; now ill-formed
              ^
p1777.cpp:43:15: error: no member named 'format' in namespace 'std'
auto s = std::format("{:d}", "I am not a number"); // ill-formed,
         ~~~~~^
p1777.cpp:53:6: error: C++ requires a type specifier for all declarations
std::format("{}", t.bit);
     ^
p1777.cpp:53:6: error: no member named 'format' in namespace 'std'
std::format("{}", t.bit);
~~~~~^
p1777.cpp:64:17: error: no template named 'set' in namespace 'std'; did you mean 'get'?
    void f(std::set<B, std::less<>>& s) {
           ~~~~~^~~
                get
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/utility:223:5: note: 'get' declared here
    get(std::pair<_Tp1, _Tp2>& __in) noexcept
    ^
p1777.cpp:64:12: error: expected parameter declarator
    void f(std::set<B, std::less<>>& s) {
           ^
p1777.cpp:64:36: error: expected ')'
    void f(std::set<B, std::less<>>& s) {
                                   ^
p1777.cpp:64:11: note: to match this '('
    void f(std::set<B, std::less<>>& s) {
          ^
p1777.cpp:81:3: error: no type named 'import' in the global namespace; did you mean simply 'import'?
  ::import j2;
  ^~~~~~~~
  import
p1777.cpp:79:9: note: 'import' declared here
  class import {};
        ^
p1777.cpp:89:26: error: redefinition of 'import' as different kind of symbol
template<typename> class import {};
                         ^
p1777.cpp:79:9: note: previous definition is here
  class import {};
        ^
p1777.cpp:90:9: error: expected member name or ';' after declaration specifiers
  import<int> f();
  ~~~~~~^
p1777.cpp:91:5: error: no template named 'import' in the global namespace
  ::import<int> g();
  ~~^
p1777.cpp:63:10: error: missing '}' at end of definition of 'D'
  struct D : private B {
         ^
p1777.cpp:105:1: note: still within definition of 'D' here
namespace N {
^
p1777.cpp:109:14: error: expected '>'
Y<operator<=> y; // ill-formed; previously well-formed
             ^
p1777.cpp:109:2: note: to match this '<'
Y<operator<=> y; // ill-formed; previously well-formed
 ^
p1777.cpp:117:15: error: cannot initialize a variable of type 'const char *' with an lvalue of type 'const char8_t *'
  const char *ps = u8s;
              ^    ~~~
p1777.cpp:119:9: error: cannot initialize a variable of type 'char *' with an rvalue of type 'char8_t *'
  char *pc = &u8c;
        ^    ~~~~
p1777.cpp:120:15: error: redefinition of 's'
  std::string s = u8"text";
              ^
p1777.cpp:43:6: note: previous definition is here
auto s = std::format("{:d}", "I am not a number"); // ill-formed,
     ^
p1777.cpp:122:3: error: C++ requires a type specifier for all declarations
  f(u8"text");
  ^
p1777.cpp:127:3: error: implicit instantiation of undefined template 'ct<char8_t>'
  ct<decltype(u8'c')>::type x;
  ^
p1777.cpp:123:29: note: template is declared here
  template<typename> struct ct;
                            ^
p1777.cpp:127:3: error: implicit instantiation of undefined template 'ct<char8_t>'
  ct<decltype(u8'c')>::type x;
  ^
p1777.cpp:123:29: note: template is declared here
  template<typename> struct ct;
                            ^
p1777.cpp:158:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage]
typedef struct {
              ^
               S
p1777.cpp:159:1: note: type is not C-compatible due to this member declaration
void f() {} // ill-formed; previously well-formed
^~~~~~~~~~~
p1777.cpp:160:3: note: type is given name 'S' for linkage purposes by this typedef declaration
} S;
  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.

$ g++ p1777.cpp -std=03 -o p1777g -I. -Wall
In file included from /usr/local/include/c++/12.1.0/atomic:38,
                 from N4910.h:11,
                 from p1777.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 \
      |  ^~~~~
p1777.cpp:127:6: warning: identifier 'decltype' is a keyword in C++11 [-Wc++11-compat]
  127 |   ct<decltype(u8'c')>::type x;
      |      ^~~~~~~~
p1777.cpp:249:41: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++11-compat]
  249 |   S(S&& other) : m(other.m) { other.m = nullptr; }
      |                                         ^~~~~~~
p1777.cpp:405:11: warning: identifier 'noexcept' is a keyword in C++11 [-Wc++11-compat]
  405 | void g1() noexcept;
      |           ^~~~~~~~
p1777.cpp:544:8: warning: identifier 'constexpr' is a keyword in C++11 [-Wc++11-compat]
  544 |        constexpr const int &f();
      |        ^~~~~~~~~
p1777.cpp:27:1: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
   27 | auto c = L"a" U"b"; // was conditionally-supported; now ill-formed
      | ^~~~
      | ----
p1777.cpp:27:6: error: 'c' does not name a type
   27 | auto c = L"a" U"b"; // was conditionally-supported; now ill-formed
      |      ^
p1777.cpp:43:1: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
   43 | auto s = std::format("{:d}", "I am not a number"); // ill-formed,
      | ^~~~
      | ----
p1777.cpp:43:6: error: 's' does not name a type
   43 | auto s = std::format("{:d}", "I am not a number"); // ill-formed,
      |      ^
p1777.cpp:52:1: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
   52 | auto t = tiny();
      | ^~~~
      | ----
p1777.cpp:52:6: error: 't' does not name a type; did you mean 'tm'?
   52 | auto t = tiny();
      |      ^
      |      tm
p1777.cpp:53:12: error: expected constructor, destructor, or type conversion before '(' token
   53 | std::format("{}", t.bit);
      |            ^
p1777.cpp:61:5: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
   61 |     auto operator<=>(const B&) const = default;
      |     ^~~~
      |     ----
p1777.cpp:61:10: error: 'operator<=' does not name a type
   61 |     auto operator<=>(const B&) const = default;
      |          ^~~~~~~~
p1777.cpp:64:17: error: 'std::set' has not been declared
   64 |     void f(std::set<B, std::less<>>& s) {
      |                 ^~~
p1777.cpp:64:20: error: expected ',' or '...' before '<' token
   64 |     void f(std::set<B, std::less<>>& s) {
      |                    ^
p1777.cpp:81:5: error: 'import' in namespace '::' does not name a type
   81 |   ::import j2;
      |     ^~~~~~
p1777.cpp:89:26: error: 'D::import' is not a template
   89 | template<typename> class import {};
      |                          ^~~~~~
p1777.cpp:79:9: note: previous declaration here
   79 |   class import {};
      |         ^~~~~~
p1777.cpp:90:3: error: 'D::import' is not a template
   90 |   import<int> f();
      |   ^~~~~~
p1777.cpp:91:5: error: 'import' in namespace '::' does not name a template type
   91 |   ::import<int> g();
      |     ^~~~~~
p1777.cpp:105:1: error: expected unqualified-id before 'namespace'
  105 | namespace N {
      | ^~~~~~~~~
p1777.cpp:116:9: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
  116 |   const auto *u8s = u8"text";
      |         ^~~~
      |         ----
p1777.cpp:116:15: error: ISO C++ forbids declaration of 'u8s' with no type [-fpermissive]
  116 |   const auto *u8s = u8"text";
      |               ^~~
p1777.cpp:116:9: error: storage class specified for 'u8s'
  116 |   const auto *u8s = u8"text";
      |         ^~~~
p1777.cpp:116:19: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  116 |   const auto *u8s = u8"text";
      |                   ^
p1777.cpp:117:18: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  117 |   const char *ps = u8s;
      |                  ^
p1777.cpp:118:3: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
  118 |   auto u8c = u8'c';
      |   ^~~~
      |   ----
p1777.cpp:118:8: error: 'u8c' does not name a type; did you mean 'u8'?
  118 |   auto u8c = u8'c';
      |        ^~~
      |        u8
p1777.cpp:119:12: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  119 |   char *pc = &u8c;
      |            ^
p1777.cpp:120:17: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  120 |   std::string s = u8"text";
      |                 ^
p1777.cpp:122:5: error: 'u8' has not been declared
  122 |   f(u8"text");
      |     ^~
p1777.cpp:122:7: error: expected ',' or '...' before string constant
  122 |   f(u8"text");
      |       ^~~~~~
p1777.cpp:122:3: error: ISO C++ forbids declaration of 'f' with no type [-fpermissive]
  122 |   f(u8"text");
      |   ^
p1777.cpp:122:3: error: 'int D::f(int)' cannot be overloaded with 'void D::f(int)'
p1777.cpp:64:10: note: previous declaration 'void D::f(int)'
   64 |     void f(std::set<B, std::less<>>& s) {
      |          ^
p1777.cpp:124:12: error: explicit specialization in non-namespace scope 'struct D'
  124 |   template<> struct ct<char> {
      |            ^
p1777.cpp:124:21: error: too few template-parameter-lists
  124 |   template<> struct ct<char> {
      |                     ^~~~~~~~
p1777.cpp:127:15: error: 'u8' was not declared in this scope
  127 |   ct<decltype(u8'c')>::type x;
      |               ^~
p1777.cpp:127:15: note: the macro 'u8' had not yet been defined
p1777.cpp:580: note: it was later defined here
  580 | #define u8 "abc"
      | 
p1777.cpp:127:20: error: a function call cannot appear in a constant-expression
  127 |   ct<decltype(u8'c')>::type x;
      |                    ^
p1777.cpp:127:21: error: template argument 1 is invalid
  127 |   ct<decltype(u8'c')>::type x;
      |                     ^
p1777.cpp:127:24: error: expected ';' at end of member declaration
  127 |   ct<decltype(u8'c')>::type x;
      |                        ^~~~
      |                            ;
p1777.cpp:127:29: error: 'x' does not name a type
  127 |   ct<decltype(u8'c')>::type x;
      |                             ^
p1777.cpp:138:5: error: 'int D::f()' cannot be overloaded with 'D::import D::f()'
  138 | int f() {
      |     ^
p1777.cpp:90:15: note: previous declaration 'D::import D::f()'
   90 |   import<int> f();
      |               ^
p1777.cpp:166:5: error: 'int D::f(int)' cannot be overloaded with 'void D::f(int)'
  166 | int f(int a = 42);
      |     ^
p1777.cpp:64:10: note: previous declaration 'void D::f(int)'
   64 |     void f(std::set<B, std::less<>>& s) {
      |          ^
p1777.cpp:169:5: error: 'int D::f(int)' cannot be overloaded with 'void D::f(int)'
  169 | int f(int a = 76) { return a; }
      |     ^
p1777.cpp:64:10: note: previous declaration 'void D::f(int)'
   64 |     void f(std::set<B, std::less<>>& s) {
      |          ^
p1777.cpp:170:5: error: 'int D::g()' cannot be overloaded with 'int D::g()'
  170 | int g();
      |     ^
p1777.cpp:167:5: note: previous declaration 'int D::g()'
  167 | int g() { return f(); }
      |     ^
p1777.cpp:178:9: warning: defaulted and deleted functions only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  178 |   A() = delete;
      |         ^~~~~~
p1777.cpp:181:9: warning: defaulted and deleted functions only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  181 |   B() = default;
      |         ^~~~~~~
p1777.cpp:182:9: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  182 |   int i = 0;
      |         ^
p1777.cpp:180:8: error: default member initializer for 'D::B::i' required before the end of its enclosing class
  180 | struct B {
      |        ^
p1777.cpp:182:9: note: defined here
  182 |   int i = 0;
      |         ^~~~
p1777.cpp:187:6: error: expected ',' or '...' before '&&' token
  187 |   C(C&&) = default;
      |      ^~
p1777.cpp:187:12: warning: defaulted and deleted functions only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  187 |   C(C&&) = default;
      |            ^~~~~~~
p1777.cpp:187:3: error: invalid constructor; you probably meant 'D::C (const D::C&)'
  187 |   C(C&&) = default;
      |   ^
p1777.cpp:190:4: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  190 | A a{};
      |    ^
p1777.cpp:191:5: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  191 | B b = {1};
      |     ^
p1777.cpp:192:1: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
  192 | auto* c = new C{2, 3};
      | ^~~~
      | ----
p1777.cpp:192:7: error: ISO C++ forbids declaration of 'c' with no type [-fpermissive]
  192 | auto* c = new C{2, 3};
      |       ^
p1777.cpp:192:1: error: storage class specified for 'c'
  192 | auto* c = new C{2, 3};
      | ^~~~
p1777.cpp:192:9: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  192 | auto* c = new C{2, 3};
      |         ^
p1777.cpp:198:17: warning: defaulted and deleted functions only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  198 |   Y(const Y&) = default;
      |                 ^~~~~~~
p1777.cpp:201:4: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  201 | Y y{X{}};
      |    ^
p1777.cpp:209:10: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  209 | bool y[] = { "bc" }; // ill-formed; previously well-formed
      |          ^
p1777.cpp:209:19: error: redeclaration of 'bool D::y []'
  209 | bool y[] = { "bc" }; // ill-formed; previously well-formed
      |                   ^
p1777.cpp:201:3: note: previous declaration 'D::Y D::y'
  201 | Y y{X{}};
      |   ^
p1777.cpp:215:8: error: using typedef-name 'D::S' after 'struct'
  215 | struct S {
      |        ^
p1777.cpp:160:3: note: 'D::S' has a previous declaration here
  160 | } S;
      |   ^
p1777.cpp:225:8: error: 'D::A' is not a template
  225 | struct A {
      |        ^
p1777.cpp:177:8: note: previous declaration here
  177 | struct A {
      |        ^
p1777.cpp:237:13: error: expected ',' or '...' before '&&' token
  237 |   base(base &&);
      |             ^~
p1777.cpp:237:3: error: invalid constructor; you probably meant 'D::base (const D::base&)'
  237 |   base(base &&);
      |   ^~~~
p1777.cpp:246:8: error: using typedef-name 'D::S' after 'struct'
  246 | struct S {
      |        ^
p1777.cpp:160:3: note: 'D::S' has a previous declaration here
  160 | } S;
      |   ^
p1777.cpp:252:12: error: expected ',' or '...' before '&&' token
  252 | S consume(S&& s) { return s; }
      |            ^~
p1777.cpp:253:6: error: 'void D::g()' cannot be overloaded with 'int D::g()'
  253 | void g() {
      |      ^
p1777.cpp:167:5: note: previous declaration 'int D::g()'
  167 | int g() { return f(); }
      |     ^
p1777.cpp:264:8: error: redefinition of 'struct D::A'
  264 | struct A {
      |        ^
p1777.cpp:177:8: note: previous definition of 'struct D::A'
  177 | struct A {
      |        ^
p1777.cpp:267:6: error: 'bool D::operator==(A, int)' must have exactly one argument
  267 | bool operator==(A, int); // #1
      |      ^~~~~~~~
p1777.cpp:269:6: error: 'bool D::operator==(int, int)' must have exactly one argument
  269 | bool operator==(int, int); // #3 is built-in candidate:
      |      ^~~~~~~~
p1777.cpp:270:6: error: 'bool D::operator!=(int, int)' must have exactly one argument
  270 | bool operator!=(int, int);
      |      ^~~~~~~~
p1777.cpp:282:13: error: redefinition of 'struct D::A'
  282 |      struct A {};
      |             ^
p1777.cpp:177:8: note: previous definition of 'struct D::A'
  177 | struct A {
      |        ^
p1777.cpp:283:11: error: 'bool D::operator<(void (*)(), A)' must have exactly one argument
  283 |      bool operator<(void (*fp)(), A);
      |           ^~~~~~~~
p1777.cpp:284:6: error: 'void D::f()' cannot be overloaded with 'D::import D::f()'
  284 | void f() {}
      |      ^
p1777.cpp:90:15: note: previous declaration 'D::import D::f()'
   90 |   import<int> f();
      |               ^
p1777.cpp:285:5: error: 'int D::main()' cannot be overloaded with 'int D::main()'
  285 | int main() {
      |     ^~~~
p1777.cpp:171:5: note: previous declaration 'int D::main()'
  171 | int main() { return g(); }
      |     ^~~~
p1777.cpp:324:1: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
  324 | auto p = new char[100];
      | ^~~~
      | ----
p1777.cpp:324:6: error: 'p' does not name a type
  324 | auto p = new char[100];
      |      ^
p1777.cpp:326:6: error: 'cin' in namespace 'std' does not name a type
  326 | std::cin >> std::setw(20) >> p; // ill-formed; previously well-formed std::cin >> std::setw(20) >> q; // OK
      |      ^~~
In file included from N4910.h:2:
/usr/local/include/c++/12.1.0/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;           /// Linked to standard input
      |                  ^~~
p1777.cpp:331:6: error: 'cout' in namespace 'std' does not name a type
  331 | std::cout << u8"text"; // previously called operator<<(const char*) and printed a string; // now ill-formed
      |      ^~~~
/usr/local/include/c++/12.1.0/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |                  ^~~~
p1777.cpp:332:6: error: 'cout' in namespace 'std' does not name a type
  332 | std::cout << u8'X'; // previously called operator<<(char) and printed a character; // now ill-formed
      |      ^~~~
/usr/local/include/c++/12.1.0/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |                  ^~~~
p1777.cpp:336:6: error: 'cout' in namespace 'std' does not name a type
  336 | std::cout << u"text"; // previously formatted the string as a pointer value; // now ill-formed
      |      ^~~~
/usr/local/include/c++/12.1.0/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |                  ^~~~
p1777.cpp:337:6: error: 'cout' in namespace 'std' does not name a type
  337 | std::cout << u'X'; // previously formatted the character as an integer value; // now ill-formed
      |      ^~~~
/usr/local/include/c++/12.1.0/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |                  ^~~~
p1777.cpp:342:6: error: 'filesystem' in namespace 'std' does not name a type; did you mean 'system'?
  342 | std::filesystem::path p;
      |      ^~~~~~~~~~
      |      system
p1777.cpp:343:16: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  343 | std::string s1 = p.u8string(); // ill-formed; previously well-formed std::string s2 = p.generic_u8string(); // ill-formed; previously well-formed
      |                ^
p1777.cpp:379:9: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  379 | int b0p = F(0p+0); // ill-formed; equivalent to “
      |         ^
p1777.cpp:380:9: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  380 | int b0p = b0p + 0; // ” in C++ 2014
      |         ^
p1777.cpp:380:17: error: redeclaration of 'int D::b0p'
  380 | int b0p = b0p + 0; // ” in C++ 2014
      |                 ^
p1777.cpp:379:5: note: previous declaration 'int D::b0p'
  379 | int b0p = F(0p+0); // ill-formed; equivalent to “
      |     ^~~
p1777.cpp:399:1: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
  399 | auto x1{1}; // was std::initializer_list<int>, now int
      | ^~~~
      | ----
p1777.cpp:399:6: error: 'x1' does not name a type
  399 | auto x1{1}; // was std::initializer_list<int>, now int
      |      ^~
p1777.cpp:400:1: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
  400 | auto x2{1, 2}; // was std::initializer_list<int>, now ill-formed
      | ^~~~
      | ----
p1777.cpp:400:6: error: 'x2' does not name a type
  400 | auto x2{1, 2}; // was std::initializer_list<int>, now ill-formed
      |      ^~
p1777.cpp:405:9: error: expected ';' at end of member declaration
  405 | void g1() noexcept;
      |         ^
      |          ;
p1777.cpp:405:11: error: 'noexcept' does not name a type
  405 | void g1() noexcept;
      |           ^~~~~~~~
p1777.cpp:405:11: note: C++11 'noexcept' only available with '-std=c++11' or '-std=gnu++11'
p1777.cpp:408:7: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  408 | int x = f(g1, g2); // ill-formed; previously well-formed
      |       ^
p1777.cpp:413:13: error: redefinition of 'struct D::base'
  413 |      struct base {
      |             ^~~~
p1777.cpp:233:13: note: previous definition of 'struct D::base'
  233 |      struct base {
      |             ^~~~
p1777.cpp:417:13: error: redefinition of 'struct D::derived'
  417 |      struct derived : base {};
      |             ^~~~~~~
p1777.cpp:239:8: note: previous definition of 'struct D::derived'
  239 | struct derived : base {};
      |        ^~~~~~~
p1777.cpp:418:11: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  418 | derived d1{};
      |           ^
p1777.cpp:426:8: error: redefinition of 'struct D::A'
  426 | struct A {
      |        ^
p1777.cpp:177:8: note: previous definition of 'struct D::A'
  177 | struct A {
      |        ^
p1777.cpp:430:8: error: redefinition of 'struct D::B'
  430 | struct B : A {
      |        ^
p1777.cpp:180:8: note: previous definition of 'struct D::B'
  180 | struct B {
      |        ^
p1777.cpp:433:5: error: expected identifier before numeric constant
  433 | B b(42L);
      |     ^~~
p1777.cpp:433:5: error: expected ',' or '...' before numeric constant
p1777.cpp:433:8: error: 'D::B D::b(int)' conflicts with a previous declaration
  433 | B b(42L);
      |        ^
p1777.cpp:191:3: note: previous declaration 'D::B D::b'
  191 | B b = {1};
      |   ^
p1777.cpp:439:27: error: 'D::A' is not a template
  439 |   template <int N> struct A;
      |                           ^
p1777.cpp:177:8: note: previous declaration here
  177 | struct A {
      |        ^
p1777.cpp:440:38: error: 'D::A' is not a template
  440 |   template <typename T, T N> int foo(A<N> *) = delete;
      |                                      ^
p1777.cpp:440:48: warning: defaulted and deleted functions only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  440 |   template <typename T, T N> int foo(A<N> *) = delete;
      |                                                ^~~~~~
p1777.cpp:442:12: error: 'D::A' is not a template
  442 |   void bar(A<0> *p) {
      |            ^
p1777.cpp:1132:2: error: expected '}' at end of input
 1132 | }
      |  ^
p1777.cpp:63:24: note: to match this '{'
   63 |   struct D : private B {
      |                        ^
p1777.cpp:116:21: error: 'u8' was not declared in this scope
  116 |   const auto *u8s = u8"text";
      |                     ^~
p1777.cpp:116:21: note: the macro 'u8' had not yet been defined
p1777.cpp:580: note: it was later defined here
  580 | #define u8 "abc"
      | 
p1777.cpp:117:20: error: cannot convert 'const int*' to 'const char*' in initialization
  117 |   const char *ps = u8s;
      |                    ^~~
      |                    |
      |                    const int*
p1777.cpp:119:15: error: 'u8c' was not declared in this scope; did you mean 'u8s'?
  119 |   char *pc = &u8c;
      |               ^~~
      |               u8s
p1777.cpp:120:19: error: 'u8' was not declared in this scope
  120 |   std::string s = u8"text";
      |                   ^~
p1777.cpp:120:19: note: the macro 'u8' had not yet been defined
p1777.cpp:580: note: it was later defined here
  580 | #define u8 "abc"
      | 
p1777.cpp:190:4: warning: extended initializer lists only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  190 | A a{};
      |    ^
p1777.cpp:190:5: warning: extended initializer lists only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  190 | A a{};
      |     ^
p1777.cpp:191:9: warning: extended initializer lists only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  191 | B b = {1};
      |         ^
p1777.cpp:191:9: error: could not convert '{1}' from '<brace-enclosed initializer list>' to 'D::B'
  191 | B b = {1};
      |         ^
      |         |
      |         <brace-enclosed initializer list>
p1777.cpp:192:16: warning: extended initializer lists only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  192 | auto* c = new C{2, 3};
      |                ^
p1777.cpp:192:21: error: cannot convert 'D::C*' to 'int*' in initialization
  192 | auto* c = new C{2, 3};
      |                     ^
p1777.cpp:201:4: warning: extended initializer lists only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  201 | Y y{X{}};
      |    ^
p1777.cpp:201:6: warning: extended initializer lists only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  201 | Y y{X{}};
      |      ^
p1777.cpp:201:8: warning: extended initializer lists only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  201 | Y y{X{}};
      |        ^
p1777.cpp:209:19: warning: extended initializer lists only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  209 | bool y[] = { "bc" }; // ill-formed; previously well-formed
      |                   ^
p1777.cpp:209:6: error: initializer for flexible array member 'bool D::y []'
  209 | bool y[] = { "bc" }; // ill-formed; previously well-formed
      |      ^
p1777.cpp:343:18: error: 'p' was not declared in this scope
  343 | std::string s1 = p.u8string(); // ill-formed; previously well-formed std::string s2 = p.generic_u8string(); // ill-formed; previously well-formed
      |                  ^
p1777.cpp:408:11: error: invalid use of non-static member function 'void D::g1()'
  408 | int x = f(g1, g2); // ill-formed; previously well-formed
      |           ^~
p1777.cpp:405:6: note: declared here
  405 | void g1() noexcept;
      |      ^~
p1777.cpp:418:11: warning: extended initializer lists only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  418 | derived d1{};
      |           ^
p1777.cpp:418:12: warning: extended initializer lists only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  418 | derived d1{};
      |            ^
p1777.cpp: In member function 'void D::f(int)':
p1777.cpp:65:8: error: no matching function for call to 'std::__cxx11::basic_string<char>::erase(D&)'
   65 | s.erase(*this); // ill formed; previously well-formed }
      | ~~~~~~~^~~~~~~
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,
                 from /usr/local/include/c++/12.1.0/iostream:39:
/usr/local/include/c++/12.1.0/bits/basic_string.h:2032:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 2032 |       erase(size_type __pos = 0, size_type __n = npos)
      |       ^~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:2032:23: note:   no known conversion for argument 1 from 'D' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
 2032 |       erase(size_type __pos = 0, size_type __n = npos)
      |             ~~~~~~~~~~^~~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:2052:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::iterator]'
 2052 |       erase(__const_iterator __position)
      |       ^~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:2052:30: note:   no known conversion for argument 1 from 'D' to 'std::__cxx11::basic_string<char>::__const_iterato' {aka 'std::__cxx11::basic_string<char>::iterator'}
 2052 |       erase(__const_iterator __position)
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:2072:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator, __const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::iterator]'
 2072 |       erase(__const_iterator __first, __const_iterator __last)
      |       ^~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:2072:7: note:   candidate expects 2 arguments, 1 provided
p1777.cpp: In member function 'int D::f()':
p1777.cpp:140:7: error: expected nested-name-specifier before 'T'
  140 | using T = int; a.~T();
      |       ^
p1777.cpp:140:19: error: request for member 'T' in non-class type 'int'
  140 | using T = int; a.~T();
      |                   ^
p1777.cpp: In member function 'int D::g()':
p1777.cpp:167:19: error: cannot convert 'D::import' to 'int' in return
  167 | int g() { return f(); }
      |                  ~^~
      |                   |
      |                   D::import
p1777.cpp: In member function 'D::S D::consume(S)':
p1777.cpp:252:27: error: could not convert '((D*)this)->D::s' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'D::S'
  252 | S consume(S&& s) { return s; }
      |                           ^
      |                           |
      |                           std::string {aka std::__cxx11::basic_string<char>}
p1777.cpp: In member function 'void D::g()':
p1777.cpp:254:13: error: no matching function for call to 'D::S::S(const char [5])'
  254 |   S s("text");
      |             ^
p1777.cpp:160:3: note: candidate: 'D::S::S()'
  160 | } S;
      |   ^
p1777.cpp:160:3: note:   candidate expects 0 arguments, 1 provided
p1777.cpp:160:3: note: candidate: 'D::S::S(const D::S&)'
p1777.cpp:160:3: note:   no known conversion for argument 1 from 'const char [5]' to 'const D::S&'
p1777.cpp:255:24: error: expected '>' before '&&' token
  255 |   consume(static_cast<S&&>(s));
      |                        ^~
p1777.cpp:255:24: error: expected '(' before '&&' token
p1777.cpp:255:26: error: expected identifier before '>' token
  255 |   consume(static_cast<S&&>(s));
      |                          ^
p1777.cpp:256:15: error: 'struct D::S' has no member named 'm'
  256 |   char c = *s.m;
      |               ^
p1777.cpp:256:8: warning: unused variable 'c' [-Wunused-variable]
  256 |   char c = *s.m;
      |        ^
p1777.cpp: In member function 'int D::check(A, A)':
p1777.cpp:272:15: error: no match for 'operator==' (operand types are 'D::A' and 'D::A')
  272 |     return (x == y) +
      |             ~ ^~ ~
      |             |    |
      |             D::A D::A
In file included from /usr/local/include/c++/12.1.0/iosfwd:40,
                 from /usr/local/include/c++/12.1.0/ios:38:
/usr/local/include/c++/12.1.0/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
  192 |     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/postypes.h:192:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::fpos<_StateT>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/string:41:
/usr/local/include/c++/12.1.0/bits/allocator.h:214:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
  214 |     operator==(const allocator<_T1>&, const allocator<_T2>&)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/allocator.h:214:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::allocator<_CharT>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/string:47:
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:444:5: note: candidate: 'template<class _Iterator> bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  444 |     operator==(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:444:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::reverse_iterator<_Iterator>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:489:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  489 |     operator==(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:489:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::reverse_iterator<_Iterator>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/bits/stl_algobase.h:64,
                 from /usr/local/include/c++/12.1.0/string:50:
/usr/local/include/c++/12.1.0/bits/stl_pair.h:640:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
  640 |     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_pair.h:640:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::pair<_T1, _T2>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3575:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
 3575 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3575:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3584:5: note: candidate: 'template<class _CharT> typename __gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, bool>::__type std::operator==(const __cxx11::basic_string<_CharT>&, const __cxx11::basic_string<_CharT>&)'
 3584 |     operator==(const basic_string<_CharT>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3584:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::__cxx11::basic_string<_CharT>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3599:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)'
 3599 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3599:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3640:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
 3640 |     operator==(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3640:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   mismatched types 'const _CharT*' and 'D::A'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/bits/locale_facets.h:48,
                 from /usr/local/include/c++/12.1.0/bits/basic_ios.h:37,
                 from /usr/local/include/c++/12.1.0/ios:44:
/usr/local/include/c++/12.1.0/bits/streambuf_iterator.h:233:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)'
  233 |     operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/streambuf_iterator.h:233:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/vector:64,
                 from N4910.h:8:
/usr/local/include/c++/12.1.0/bits/stl_vector.h:2035:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator==(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
 2035 |     operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_vector.h:2035:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::vector<_Tp, _Alloc>'
  272 |     return (x == y) +
      |                  ^
In file included from N4910.h:9:
/usr/local/include/c++/12.1.0/complex:464:5: note: candidate: 'template<class _Tp> bool std::operator==(const complex<_Tp>&, const complex<_Tp>&)'
  464 |     operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/complex:464:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::complex<_Tp>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/complex:469:5: note: candidate: 'template<class _Tp> bool std::operator==(const complex<_Tp>&, const _Tp&)'
  469 |     operator==(const complex<_Tp>& __x, const _Tp& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/complex:469:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::complex<_Tp>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/complex:475:5: note: candidate: 'template<class _Tp> bool std::operator==(const _Tp&, const complex<_Tp>&)'
  475 |     operator==(const _Tp& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/complex:475:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::complex<_Tp>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/map:61,
                 from N4910.h:10:
/usr/local/include/c++/12.1.0/bits/stl_map.h:1511:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator==(const map<_Key, _Tp, _Compare, _Alloc>&, const map<_Key, _Tp, _Compare, _Alloc>&)'
 1511 |     operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_map.h:1511:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::map<_Key, _Tp, _Compare, _Alloc>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/map:62:
/usr/local/include/c++/12.1.0/bits/stl_multimap.h:1132:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator==(const multimap<_Key, _Tp, _Compare, _Alloc>&, const multimap<_Key, _Tp, _Compare, _Alloc>&)'
 1132 |     operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_multimap.h:1132:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::multimap<_Key, _Tp, _Compare, _Alloc>'
  272 |     return (x == y) +
      |                  ^
p1777.cpp:273:11: error: no match for 'operator==' (operand types are 'int' and 'D::A')
  273 |       (10 == x) +
      |        ~~ ^~ ~
      |        |     |
      |        int   D::A
/usr/local/include/c++/12.1.0/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
  192 |     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/postypes.h:192:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::fpos<_StateT>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/allocator.h:214:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
  214 |     operator==(const allocator<_T1>&, const allocator<_T2>&)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/allocator.h:214:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::allocator<_CharT>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:444:5: note: candidate: 'template<class _Iterator> bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  444 |     operator==(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:444:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:489:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  489 |     operator==(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:489:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_pair.h:640:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
  640 |     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_pair.h:640:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::pair<_T1, _T2>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3575:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
 3575 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3575:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3584:5: note: candidate: 'template<class _CharT> typename __gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, bool>::__type std::operator==(const __cxx11::basic_string<_CharT>&, const __cxx11::basic_string<_CharT>&)'
 3584 |     operator==(const basic_string<_CharT>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3584:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::__cxx11::basic_string<_CharT>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3599:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)'
 3599 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3599:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3640:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
 3640 |     operator==(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3640:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const _CharT*' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/streambuf_iterator.h:233:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)'
  233 |     operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/streambuf_iterator.h:233:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::istreambuf_iterator<_CharT, _Traits>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_vector.h:2035:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator==(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
 2035 |     operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_vector.h:2035:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/complex:464:5: note: candidate: 'template<class _Tp> bool std::operator==(const complex<_Tp>&, const complex<_Tp>&)'
  464 |     operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/complex:464:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::complex<_Tp>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/complex:469:5: note: candidate: 'template<class _Tp> bool std::operator==(const complex<_Tp>&, const _Tp&)'
  469 |     operator==(const complex<_Tp>& __x, const _Tp& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/complex:469:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::complex<_Tp>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/complex:475:5: note: candidate: 'template<class _Tp> bool std::operator==(const _Tp&, const complex<_Tp>&)'
  475 |     operator==(const _Tp& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/complex:475:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::complex<_Tp>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_map.h:1511:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator==(const map<_Key, _Tp, _Compare, _Alloc>&, const map<_Key, _Tp, _Compare, _Alloc>&)'
 1511 |     operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_map.h:1511:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::map<_Key, _Tp, _Compare, _Alloc>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_multimap.h:1132:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator==(const multimap<_Key, _Tp, _Compare, _Alloc>&, const multimap<_Key, _Tp, _Compare, _Alloc>&)'
 1132 |     operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_multimap.h:1132:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::multimap<_Key, _Tp, _Compare, _Alloc>' and 'int'
  273 |       (10 == x) +
      |              ^
p1777.cpp:274:11: error: no match for 'operator!=' (operand types are 'int' and 'D::A')
  274 |       (10 != x);
      |        ~~ ^~ ~
      |        |     |
      |        int   D::A
/usr/local/include/c++/12.1.0/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)'
  197 |     operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/postypes.h:197:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::fpos<_StateT>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/allocator.h:221:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)'
  221 |     operator!=(const allocator<_T1>&, const allocator<_T2>&)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/allocator.h:221:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::allocator<_CharT>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:458:5: note: candidate: 'template<class _Iterator> bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  458 |     operator!=(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:458:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:503:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  503 |     operator!=(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:503:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_pair.h:670:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
  670 |     operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_pair.h:670:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::pair<_T1, _T2>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3653:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
 3653 |     operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3653:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3666:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
 3666 |     operator!=(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3666:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const _CharT*' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3678:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)'
 3678 |     operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3678:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/streambuf_iterator.h:241:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)'
  241 |     operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/streambuf_iterator.h:241:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::istreambuf_iterator<_CharT, _Traits>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_vector.h:2081:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator!=(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
 2081 |     operator!=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_vector.h:2081:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/complex:483:5: note: candidate: 'template<class _Tp> bool std::operator!=(const complex<_Tp>&, const complex<_Tp>&)'
  483 |     operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/complex:483:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::complex<_Tp>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/complex:488:5: note: candidate: 'template<class _Tp> bool std::operator!=(const complex<_Tp>&, const _Tp&)'
  488 |     operator!=(const complex<_Tp>& __x, const _Tp& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/complex:488:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::complex<_Tp>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/complex:493:5: note: candidate: 'template<class _Tp> bool std::operator!=(const _Tp&, const complex<_Tp>&)'
  493 |     operator!=(const _Tp& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/complex:493:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::complex<_Tp>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_map.h:1556:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator!=(const map<_Key, _Tp, _Compare, _Alloc>&, const map<_Key, _Tp, _Compare, _Alloc>&)'
 1556 |     operator!=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_map.h:1556:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::map<_Key, _Tp, _Compare, _Alloc>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_multimap.h:1177:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator!=(const multimap<_Key, _Tp, _Compare, _Alloc>&, const multimap<_Key, _Tp, _Compare, _Alloc>&)'
 1177 |     operator!=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_multimap.h:1177:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::multimap<_Key, _Tp, _Compare, _Alloc>' and 'int'
  274 |       (10 != x);
      |              ^
p1777.cpp: In member function 'int D::main()':
p1777.cpp:287:5: error: 'a' cannot appear in a constant-expression
  287 | f < a; // ill-formed; previously well-formed (f) < a; // still well formed
      |     ^
p1777.cpp:287:1: error: parse error in template argument list
  287 | f < a; // ill-formed; previously well-formed (f) < a; // still well formed
      | ^~~~~
p1777.cpp:287:6: error: statement cannot resolve address of overloaded function
  287 | f < a; // ill-formed; previously well-formed (f) < a; // still well formed
      |      ^
p1777.cpp:288:1: warning: no return statement in function returning non-void [-Wreturn-type]
  288 | }
      | ^
p1777.cpp: In member function 'void D::bar(A*)':
p1777.cpp:467:8: error: 'unique_ptr' is not a member of 'std'
  467 |   std::unique_ptr<int[]> arr(new int[1]);
      |        ^~~~~~~~~~
p1777.cpp:467:8: note: 'std::unique_ptr' is only available from C++11 onwards
p1777.cpp:467:19: error: expected primary-expression before 'int'
  467 |   std::unique_ptr<int[]> arr(new int[1]);
      |                   ^~~
p1777.cpp:468:8: error: 'shared_ptr' is not a member of 'std'
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |        ^~~~~~~~~~
p1777.cpp:468:8: note: 'std::shared_ptr' is only available from C++11 onwards
p1777.cpp:468:19: error: expected primary-expression before 'int'
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |                   ^~~
p1777.cpp:475:13: warning: declaration of 'int f(char*)' has 'extern' and is initialized
  475 | int f(char *) = delete;
      |             ^
p1777.cpp:475:17: warning: defaulted and deleted functions only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  475 | int f(char *) = delete;
      |                 ^~~~~~
In file included from /usr/local/include/c++/12.1.0/cstddef:49,
                 from N4910.h:1:
/usr/local/include/c++/12.1.0/bits/stl_set.h:64:15: error: expected '=' before '__attribute__'
   64 | namespace std _GLIBCXX_VISIBILITY(default)
      |               ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_set.h:64:15: error: expected identifier before '__attribute__'
/usr/local/include/c++/12.1.0/bits/stl_set.h:64:15: error: expected ';' before '__attribute__'
In file included from /usr/local/include/c++/12.1.0/set:61,
                 from p1777.cpp:484:
/usr/local/include/c++/12.1.0/bits/stl_set.h:65:1: error: expected primary-expression before '{' token
   65 | {
      | ^
/usr/local/include/c++/12.1.0/bits/stl_multiset.h:64:15: error: expected '=' before '__attribute__'
   64 | namespace std _GLIBCXX_VISIBILITY(default)
      |               ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_multiset.h:64:15: error: expected identifier before '__attribute__'
/usr/local/include/c++/12.1.0/bits/stl_multiset.h:64:15: error: expected ';' before '__attribute__'
In file included from /usr/local/include/c++/12.1.0/set:62:
/usr/local/include/c++/12.1.0/bits/stl_multiset.h:65:1: error: expected primary-expression before '{' token
   65 | {
      | ^
p1777.cpp:491:11: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
  491 |   int main() {
      |           ^~
p1777.cpp:491:11: note: remove parentheses to default-initialize a variable
  491 |   int main() {
      |           ^~
      |           --
p1777.cpp:491:14: error: a function-definition is not allowed here before '{' token
  491 |   int main() {
      |              ^
p1777.cpp:511:5: error: conflicting declaration 'int x [2]'
  511 | int x[2] = { M(1'2,3'4, 5) };
      |     ^
p1777.cpp:478:5: note: previous declaration as 'int x'
  478 | int x = f(s.data()); // ill-formed; previously well-formed
      |     ^
p1777.cpp:520:47: error: expected initializer before 'noexcept'
  520 |      void operator delete(void*, std::size_t) noexcept;
      |                                               ^~~~~~~~
p1777.cpp:528:14: warning: non-static data member initializers only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  528 |        int x = 1;
      |              ^
p1777.cpp:531:23: error: a function-definition is not allowed here before '{' token
  531 |      int f(bool cond) {
      |                       ^
p1777.cpp:543:13: error: redefinition of 'struct D::bar(A*)::S'
  543 |      struct S {
      |             ^
p1777.cpp:527:13: note: previous definition of 'struct D::bar(A*)::S'
  527 |      struct S {
      |             ^
p1777.cpp:551:8: error: redefinition of 'struct D::bar(A*)::S'
  551 | struct S {
      |        ^
p1777.cpp:527:13: note: previous definition of 'struct D::bar(A*)::S'
  527 |      struct S {
      |             ^
p1777.cpp:558:4: warning: extended initializer lists only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  558 | X a{}; S b{a};
      |    ^
p1777.cpp:558:11: warning: extended initializer lists only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
  558 | X a{}; S b{a};
      |           ^
p1777.cpp:558:10: error: in C++98 'b' must be initialized by constructor, not by '{...}'
  558 | X a{}; S b{a};
      |          ^
p1777.cpp:581:13: error: conflicting declaration 'const char* s'
  581 | const char* s = u8"def"; // Previously "abcdef", now "def"
      |             ^
p1777.cpp:477:8: note: previous declaration as 'std::string s'
  477 | string s;
      |        ^
p1777.cpp:603:1: error: a template declaration cannot appear at block scope
  603 | template<int N> void g() {
      | ^~~~~~~~
p1777.cpp:615:10: error: redefinition of 'struct D::bar(A*)::S'
  615 |   struct S { operator int(); };
      |          ^
p1777.cpp:527:13: note: previous definition of 'struct D::bar(A*)::S'
  527 |      struct S {
      |             ^
cc1plus: error: 'operator int' is not a member of 'D::bar(A*)::S'
p1777.cpp:627:10: error: conflicting declaration 'int x []'
  627 |      int x[] = { 2.0 };
      |          ^
p1777.cpp:478:5: note: previous declaration as 'int x'
  478 | int x = f(s.data()); // ill-formed; previously well-formed
      |     ^
p1777.cpp:646:6: error: a template declaration cannot appear at block scope
  646 |      template <class T> struct X { };
      |      ^~~~~~~~
p1777.cpp:647:6: error: a template declaration cannot appear at block scope
  647 |      template <int N> struct Y { };
      |      ^~~~~~~~
p1777.cpp:648:6: error: 'D::bar(A*)::X' is not a template
  648 |      X< Y< 1 >> 2 > > x;
      |      ^
p1777.cpp:648:9: error: 'D::Y' is not a template
  648 |      X< Y< 1 >> 2 > > x;
      |         ^
p1777.cpp:648:14: warning: '>>' operator is treated as two right angle brackets in C++11 [-Wc++11-compat]
  648 |      X< Y< 1 >> 2 > > x;
      |              ^~
p1777.cpp:648:14: note: suggest parentheses around '>>' expression
p1777.cpp:648:23: error: conflicting declaration 'D::bar(A*)::X x'
  648 |      X< Y< 1 >> 2 > > x;
      |                       ^
p1777.cpp:478:5: note: previous declaration as 'int x'
  478 | int x = f(s.data()); // ill-formed; previously well-formed
      |     ^
p1777.cpp:764:1: error: expected primary-expression before 'int'
  764 | int main2() {
      | ^~~
p1777.cpp:764:1: error: expected ')' before 'int'
p1777.cpp:717:1: note: to match this '('
  717 | (// 4.1) (4.2) (4.3) (4.4)
      | ^
p1777.cpp:799:7: error: declaration of 'char* p' shadows a parameter
  799 | char* p = "abc";
      |       ^
p1777.cpp:442:18: note: 'D::A* p' previously declared here
  442 |   void bar(A<0> *p) {
      |            ~~~~~~^
p1777.cpp:799:11: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
  799 | char* p = "abc";
      |           ^~~~~
p1777.cpp:800:15: error: a function-definition is not allowed here before '{' token
  800 | void f(char*) {
      |               ^
p1777.cpp:811:12: error: redeclaration of 'int i'
  811 | int i; int i;
      |            ^
p1777.cpp:811:5: note: 'int i' previously declared here
  811 | int i; int i;
      |     ^
p1777.cpp:813:13: error: redefinition of 'struct D::bar(A*)::X'
  813 |      struct X { int i; struct X* next; };
      |             ^
p1777.cpp:554:8: note: previous definition of 'struct D::bar(A*)::X'
  554 | struct X {
      |        ^
p1777.cpp:814:22: error: redeclaration of 'D::bar(A*)::X a'
  814 |      static struct X a;
      |                      ^
p1777.cpp:558:3: note: 'D::bar(A*)::X a' previously declared here
  558 | X a{}; S b{a};
      |   ^
p1777.cpp:815:22: error: conflicting declaration 'D::bar(A*)::X b'
  815 |      static struct X b = { 0, &a };
      |                      ^
p1777.cpp:558:10: note: previous declaration as 'D::bar(A*)::S b'
  558 | X a{}; S b{a};
      |          ^
p1777.cpp:816:22: error: redeclaration of 'D::bar(A*)::X a'
  816 |      static struct X a = { 1, &b };
      |                      ^
p1777.cpp:558:3: note: 'D::bar(A*)::X a' previously declared here
  558 | X a{}; S b{a};
      |   ^
p1777.cpp:821:13: error: redefinition of 'struct D::bar(A*)::X'
  821 |      struct X {
      |             ^
p1777.cpp:554:8: note: previous definition of 'struct D::bar(A*)::X'
  554 | struct X {
      |        ^
p1777.cpp:824:10: error: no matching function for call to 'D::Y::Y()'
  824 | struct Y c;
      |          ^
p1777.cpp:198:3: note: candidate: 'D::Y::Y(const D::Y&)'
  198 |   Y(const Y&) = default;
      |   ^
p1777.cpp:198:3: note:   candidate expects 1 argument, 0 provided
p1777.cpp:850:11: error: conflicting declaration 'char a [10]'
  850 |      char a[10];
      |           ^
p1777.cpp:558:3: note: previous declaration as 'D::bar(A*)::X a'
  558 | X a{}; S b{a};
      |   ^
p1777.cpp:851:12: error: conflicting declaration 'void* b'
  851 |      void* b=a;
      |            ^
p1777.cpp:558:10: note: previous declaration as 'D::bar(A*)::S b'
  558 | X a{}; S b{a};
      |          ^
p1777.cpp:852:17: error: a function-definition is not allowed here before '{' token
  852 |      void foo() {
      |                 ^
p1777.cpp:857:12: error: conflicting declaration 'char* c'
  857 |      char* c = (char*) b;
      |            ^
p1777.cpp:824:10: note: previous declaration as 'D::Y c'
  824 | struct Y c;
      |          ^
p1777.cpp:857:16: error: invalid cast from type 'D::bar(A*)::S' to type 'char*'
  857 |      char* c = (char*) b;
      |                ^~~~~~~~~
p1777.cpp:872:27: error: types may not be defined in casts
  872 |      p = (void*)(struct x {int i;} *)0;
      |                           ^
p1777.cpp:872:10: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
  872 |      p = (void*)(struct x {int i;} *)0;
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |          |
      |          void*
p1777.cpp:902:1: error: expected ';' before 'static'
  902 | static struct S { // valid C, invalid in C++ int i;
      | ^~~~~~
p1777.cpp:882:6: warning: statement has no effect [-Wunused-value]
  882 |      sizeof(0, arr)
      |      ^~~~~~~~~~~~~~
p1777.cpp:919:12: error: using typedef-name 'name' after 'class'
  919 |      class name { /* ... */ };
      |            ^~~~
p1777.cpp:916:13: note: 'name' has a previous declaration here
  916 | typedef int name; // valid C, invalid C++
      |             ^~~~
p1777.cpp:920:6: error: redeclaration of 'name i'
  920 | name i; // i has type class name
      |      ^
p1777.cpp:811:5: note: 'int i' previously declared here
  811 | int i; int i;
      |     ^
p1777.cpp:930:14: error: 'parm' does not name a type
  930 | void f(const parm);
      |              ^~~~
p1777.cpp:931:7: error: 'n' does not name a type
  931 | const n = 3;
      |       ^
p1777.cpp:932:1: error: 'main3' was not declared in this scope; did you mean 'main'?
  932 | main3(){};
      | ^~~~~
      | main
p1777.cpp:936:10: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
  936 | int main4(){};
      |          ^~
p1777.cpp:936:10: note: remove parentheses to default-initialize a variable
  936 | int main4(){};
      |          ^~
      |          --
p1777.cpp:936:12: error: a function-definition is not allowed here before '{' token
  936 | int main4(){};
      |            ^
p1777.cpp:943:10: error: a function-definition is not allowed here before '{' token
  943 | void f() {
      |          ^
p1777.cpp:953:6: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
  953 | int f(); // means int f(void) in C++ // int f( unknown ) in C
      |      ^~
p1777.cpp:953:6: note: remove parentheses to default-initialize a variable
  953 | int f(); // means int f(void) in C++ // int f( unknown ) in C
      |      ^~
      |      --
p1777.cpp:962:16: error: redefinition of 'struct D::bar(A*)::S'
  962 | void f( struct S { int a; }
      |                ^
p1777.cpp:527:13: note: previous definition of 'struct D::bar(A*)::S'
  527 |      struct S {
      |             ^
p1777.cpp:964:6: error: types may not be defined in parameter types
  964 | enum E { A, B, C };
      |      ^
p1777.cpp:962:9: error: two or more data types in declaration of 'parameter'
  962 | void f( struct S { int a; }
      |         ^~~~~~
p1777.cpp:964:19: error: expected ')' before ';' token
  964 | enum E { A, B, C };
      |                   ^
p1777.cpp:962:7: note: to match this '('
  962 | void f( struct S { int a; }
      |       ^
p1777.cpp:965:2: error: call of overloaded 'f()' is ambiguous
  965 | f() {};
      | ~^~
p1777.cpp:962:6: note: candidate: 'void f(...)'
  962 | void f( struct S { int a; }
      |      ^
p1777.cpp:953:5: note: candidate: 'int f()'
  953 | int f(); // means int f(void) in C++ // int f( unknown ) in C
      |     ^
p1777.cpp:982:10: error: conflicting declaration 'D::bar(A*)::A a'
  982 | struct A a = {.y = 1, .x = 2}; //validC,invalidC++
      |          ^
p1777.cpp:558:3: note: previous declaration as 'D::bar(A*)::X a'
  558 | X a{}; S b{a};
      |   ^
p1777.cpp:983:5: error: conflicting declaration 'int arr [3]'
  983 | int arr[3] = {[1] = 5};
      |     ^~~
p1777.cpp:881:11: note: previous declaration as 'char arr [100]'
  881 |      char arr[100];
      |           ^~~
p1777.cpp:984:10: error: conflicting declaration 'D::bar(A*)::B b'
  984 | struct B b = {.a.x = 0};
      |          ^
p1777.cpp:558:10: note: previous declaration as 'D::bar(A*)::S b'
  558 | X a{}; S b{a};
      |          ^
p1777.cpp:984:15: error: expected primary-expression before '.' token
  984 | struct B b = {.a.x = 0};
      |               ^
p1777.cpp:985:10: error: conflicting declaration 'D::bar(A*)::A c'
  985 | struct A c = {.x = 1, 2};
      |          ^
p1777.cpp:824:10: note: previous declaration as 'D::Y c'
  824 | struct Y c;
      |          ^
p1777.cpp:994:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
  994 | char array[4] = "abcd"; // valid C, invalid C++
      |                 ^~~~~~
p1777.cpp:1003:12: error: conflicting declaration 'D::bar(A*)::color c'
 1003 | enum color c = 1; // valid C, invalid C++
      |            ^
p1777.cpp:824:10: note: previous declaration as 'D::Y c'
  824 | struct Y c;
      |          ^
p1777.cpp:1013:1: error: expected ';' before 'sizeof'
 1013 | sizeof(A) == sizeof(e) // in C++
      | ^~~~~~
p1777.cpp:1012:11: warning: statement has no effect [-Wunused-value]
 1012 | sizeof(A) == sizeof(int) // in C
      | ~~~~~~~~~~^~~~~~~~~~~~~~
p1777.cpp:1024:15: error: a function-definition is not allowed here before '{' token
 1024 |      void f() {
      |               ^
p1777.cpp:1034:8: error: redefinition of 'struct D::bar(A*)::X'
 1034 | struct X { int i; };
      |        ^
p1777.cpp:554:8: note: previous definition of 'struct D::bar(A*)::X'
  554 | struct X {
      |        ^
p1777.cpp:1035:26: error: too many initializers for 'volatile D::bar(A*)::X'
 1035 | volatile struct X x1 = {0};
      |                          ^
p1777.cpp:1036:15: error: binding reference of type 'const D::bar(A*)::X&' to 'volatile D::bar(A*)::X' discards qualifiers
 1036 | struct X x2 = x1; // invalid C++ struct X x3;
      |               ^~
p1777.cpp:554:8: note:   initializing argument 1 of 'D::bar(A*)::X::X(const D::bar(A*)::X&)'
  554 | struct X {
      |        ^
p1777.cpp:1037:1: error: 'x3' was not declared in this scope; did you mean 'x'?
 1037 | x3=x1; // also invalid C++
      | ^~
      | x
p1777.cpp:1051:13: error: redefinition of 'struct D::bar(A*)::X'
 1051 |      struct X {
      |             ^
p1777.cpp:554:8: note: previous definition of 'struct D::bar(A*)::X'
  554 | struct X {
      |        ^
p1777.cpp:1054:10: error: no matching function for call to 'D::Y::Y()'
 1054 | struct Y yy; // valid C, invalid C++
      |          ^~
p1777.cpp:198:3: note: candidate: 'D::Y::Y(const D::Y&)'
  198 |   Y(const Y&) = default;
      |   ^
p1777.cpp:198:3: note:   candidate expects 1 argument, 0 provided
p1777.cpp:1059:8: error: redefinition of 'struct D::bar(A*)::X'
 1059 | struct X {
      |        ^
p1777.cpp:554:8: note: previous definition of 'struct D::bar(A*)::X'
  554 | struct X {
      |        ^
p1777.cpp:1068:10: error: redefinition of 'struct D::bar(A*)::S'
 1068 |   struct S {
      |          ^
p1777.cpp:527:13: note: previous definition of 'struct D::bar(A*)::S'
  527 |      struct S {
      |             ^
p1777.cpp:1126:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
 1126 | int main() {
      |         ^~
p1777.cpp:1126:9: note: remove parentheses to default-initialize a variable
 1126 | int main() {
      |         ^~
      |         --
p1777.cpp:1126:12: error: a function-definition is not allowed here before '{' token
 1126 | int main() {
      |            ^
p1777.cpp:1132:2: error: expected '}' at end of input
 1132 | }
      |  ^
p1777.cpp:442:21: note: to match this '{'
  442 |   void bar(A<0> *p) {
      |                     ^
p1777.cpp:478:5: warning: unused variable 'x' [-Wunused-variable]
  478 | int x = f(s.data()); // ill-formed; previously well-formed
      |     ^
p1777.cpp:616:8: warning: unused variable 'b2' [-Wunused-variable]
  616 |   bool b2 = &S::operator int && false;
      |        ^~
p1777.cpp:811:5: warning: unused variable 'i' [-Wunused-variable]
  811 | int i; int i;
      |     ^
p1777.cpp:824:10: warning: unused variable 'c' [-Wunused-variable]
  824 | struct Y c;
      |          ^
p1777.cpp:935:11: warning: unused variable 'n' [-Wunused-variable]
  935 | const int n = 3;
      |           ^
p1777.cpp:994:6: warning: unused variable 'array' [-Wunused-variable]
  994 | char array[4] = "abcd"; // valid C, invalid C++
      |      ^~~~~
p1777.cpp:1036:10: warning: unused variable 'x2' [-Wunused-variable]
 1036 | struct X x2 = x1; // invalid C++ struct X x3;
      |          ^~
p1777.cpp:1054:10: warning: unused variable 'yy' [-Wunused-variable]
 1054 | struct Y yy; // valid C, invalid C++
      |          ^~
p1777.cpp: At global scope:
p1777.cpp:1132:2: error: expected unqualified-id at end of input
 1132 | }
      |  ^

$ g++ p1777.cpp -std=2b -o p1777g -I. -Wall
p1777.cpp:378:14: error: pasting "b" and "0p+0" does not give a valid preprocessing token
  378 | #define F(a) b ## a
      |              ^
p1777.cpp:379:11: note: in expansion of macro 'F'
  379 | int b0p = F(0p+0); // ill-formed; equivalent to “
      |           ^
p1777.cpp:27:15: error: concatenation of string literals with conflicting encoding prefixes
   27 | auto c = L"a" U"b"; // was conditionally-supported; now ill-formed
      |          ~~~~ ^~~~
p1777.cpp:43:15: error: 'format' is not a member of 'std'
   43 | auto s = std::format("{:d}", "I am not a number"); // ill-formed,
      |               ^~~~~~
p1777.cpp:53:12: error: expected constructor, destructor, or type conversion before '(' token
   53 | std::format("{}", t.bit);
      |            ^
p1777.cpp:64:12: error: 'std::set' has not been declared
   64 |     void f(std::set<B, std::less<>>& s) {
      |            ^~~
p1777.cpp:64:20: error: expected ',' or '...' before '<' token
   64 |     void f(std::set<B, std::less<>>& s) {
      |                    ^
p1777.cpp:81:5: error: 'import' in namespace '::' does not name a type
   81 |   ::import j2;
      |     ^~~~~~
p1777.cpp:89:26: error: 'D::import' is not a template
   89 | template<typename> class import {};
      |                          ^~~~~~
p1777.cpp:79:9: note: previous declaration here
   79 |   class import {};
      |         ^~~~~~
p1777.cpp:90:3: error: 'D::import' is not a template
   90 |   import<int> f();
      |   ^~~~~~
p1777.cpp:91:5: error: 'import' in namespace '::' does not name a template type
   91 |   ::import<int> g();
      |     ^~~~~~
p1777.cpp:105:1: error: expected unqualified-id before 'namespace'
  105 | namespace N {
      | ^~~~~~~~~
p1777.cpp:116:9: error: non-static data member declared with placeholder 'const auto'
  116 |   const auto *u8s = u8"text";
      |         ^~~~
p1777.cpp:118:3: error: non-static data member declared with placeholder 'auto'
  118 |   auto u8c = u8'c';
      |   ^~~~
p1777.cpp:122:5: error: expected identifier before string constant
  122 |   f(u8"text");
      |     ^~~~~~~~
p1777.cpp:122:5: error: expected ',' or '...' before string constant
p1777.cpp:122:3: error: ISO C++ forbids declaration of 'f' with no type [-fpermissive]
  122 |   f(u8"text");
      |   ^
p1777.cpp:122:3: error: 'int D::f(int)' cannot be overloaded with 'void D::f(int)'
p1777.cpp:64:10: note: previous declaration 'void D::f(int)'
   64 |     void f(std::set<B, std::less<>>& s) {
      |          ^
p1777.cpp:124:12: error: explicit specialization in non-namespace scope 'struct D'
  124 |   template<> struct ct<char> {
      |            ^
p1777.cpp:124:21: error: too few template-parameter-lists
  124 |   template<> struct ct<char> {
      |                     ^~~~~~~~
p1777.cpp:127:24: error: invalid use of incomplete type 'struct D::ct<char8_t>'
  127 |   ct<decltype(u8'c')>::type x;
      |                        ^~~~
p1777.cpp:123:29: note: declaration of 'struct D::ct<char8_t>'
  123 |   template<typename> struct ct;
      |                             ^~
p1777.cpp:138:5: error: 'int D::f()' cannot be overloaded with 'D::import D::f()'
  138 | int f() {
      |     ^
p1777.cpp:90:15: note: previous declaration 'D::import D::f()'
   90 |   import<int> f();
      |               ^
p1777.cpp:166:5: error: 'int D::f(int)' cannot be overloaded with 'void D::f(int)'
  166 | int f(int a = 42);
      |     ^
p1777.cpp:64:10: note: previous declaration 'void D::f(int)'
   64 |     void f(std::set<B, std::less<>>& s) {
      |          ^
p1777.cpp:169:5: error: 'int D::f(int)' cannot be overloaded with 'void D::f(int)'
  169 | int f(int a = 76) { return a; }
      |     ^
p1777.cpp:64:10: note: previous declaration 'void D::f(int)'
   64 |     void f(std::set<B, std::less<>>& s) {
      |          ^
p1777.cpp:170:5: error: 'int D::g()' cannot be overloaded with 'int D::g()'
  170 | int g();
      |     ^
p1777.cpp:167:5: note: previous declaration 'int D::g()'
  167 | int g() { return f(); }
      |     ^
p1777.cpp:192:1: error: non-static data member declared with placeholder 'auto'
  192 | auto* c = new C{2, 3};
      | ^~~~
p1777.cpp:209:19: error: redeclaration of 'bool D::y []'
  209 | bool y[] = { "bc" }; // ill-formed; previously well-formed
      |                   ^
p1777.cpp:201:3: note: previous declaration 'D::Y D::y'
  201 | Y y{X{}};
      |   ^
p1777.cpp:215:8: error: using typedef-name 'D::S' after 'struct'
  215 | struct S {
      |        ^
p1777.cpp:160:3: note: 'D::S' has a previous declaration here
  160 | } S;
      |   ^
p1777.cpp:225:8: error: 'D::A' is not a template
  225 | struct A {
      |        ^
p1777.cpp:177:8: note: previous declaration here
  177 | struct A {
      |        ^
p1777.cpp:246:8: error: using typedef-name 'D::S' after 'struct'
  246 | struct S {
      |        ^
p1777.cpp:160:3: note: 'D::S' has a previous declaration here
  160 | } S;
      |   ^
p1777.cpp:253:6: error: 'void D::g()' cannot be overloaded with 'int D::g()'
  253 | void g() {
      |      ^
p1777.cpp:167:5: note: previous declaration 'int D::g()'
  167 | int g() { return f(); }
      |     ^
p1777.cpp:264:8: error: redefinition of 'struct D::A'
  264 | struct A {
      |        ^
p1777.cpp:177:8: note: previous definition of 'struct D::A'
  177 | struct A {
      |        ^
p1777.cpp:267:6: error: 'bool D::operator==(A, int)' must have exactly one argument
  267 | bool operator==(A, int); // #1
      |      ^~~~~~~~
p1777.cpp:269:6: error: 'bool D::operator==(int, int)' must have exactly one argument
  269 | bool operator==(int, int); // #3 is built-in candidate:
      |      ^~~~~~~~
p1777.cpp:270:6: error: 'bool D::operator!=(int, int)' must have exactly one argument
  270 | bool operator!=(int, int);
      |      ^~~~~~~~
p1777.cpp:282:13: error: redefinition of 'struct D::A'
  282 |      struct A {};
      |             ^
p1777.cpp:177:8: note: previous definition of 'struct D::A'
  177 | struct A {
      |        ^
p1777.cpp:283:11: error: 'bool D::operator<(void (*)(), A)' must have exactly one argument
  283 |      bool operator<(void (*fp)(), A);
      |           ^~~~~~~~
p1777.cpp:284:6: error: 'void D::f()' cannot be overloaded with 'D::import D::f()'
  284 | void f() {}
      |      ^
p1777.cpp:90:15: note: previous declaration 'D::import D::f()'
   90 |   import<int> f();
      |               ^
p1777.cpp:285:5: error: 'int D::main()' cannot be overloaded with 'int D::main()'
  285 | int main() {
      |     ^~~~
p1777.cpp:171:5: note: previous declaration 'int D::main()'
  171 | int main() { return g(); }
      |     ^~~~
p1777.cpp:324:1: error: non-static data member declared with placeholder 'auto'
  324 | auto p = new char[100];
      | ^~~~
p1777.cpp:326:6: error: 'cin' in namespace 'std' does not name a type
  326 | std::cin >> std::setw(20) >> p; // ill-formed; previously well-formed std::cin >> std::setw(20) >> q; // OK
      |      ^~~
In file included from N4910.h:2,
                 from p1777.cpp:10:
/usr/local/include/c++/12.1.0/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;           /// Linked to standard input
      |                  ^~~
p1777.cpp:331:6: error: 'cout' in namespace 'std' does not name a type
  331 | std::cout << u8"text"; // previously called operator<<(const char*) and printed a string; // now ill-formed
      |      ^~~~
/usr/local/include/c++/12.1.0/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |                  ^~~~
p1777.cpp:332:6: error: 'cout' in namespace 'std' does not name a type
  332 | std::cout << u8'X'; // previously called operator<<(char) and printed a character; // now ill-formed
      |      ^~~~
/usr/local/include/c++/12.1.0/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |                  ^~~~
p1777.cpp:336:6: error: 'cout' in namespace 'std' does not name a type
  336 | std::cout << u"text"; // previously formatted the string as a pointer value; // now ill-formed
      |      ^~~~
/usr/local/include/c++/12.1.0/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |                  ^~~~
p1777.cpp:337:6: error: 'cout' in namespace 'std' does not name a type
  337 | std::cout << u'X'; // previously formatted the character as an integer value; // now ill-formed
      |      ^~~~
/usr/local/include/c++/12.1.0/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |                  ^~~~
p1777.cpp:342:6: error: 'filesystem' in namespace 'std' does not name a type; did you mean 'system'?
  342 | std::filesystem::path p;
      |      ^~~~~~~~~~
      |      system
p1777.cpp:380:17: error: redeclaration of 'int D::b0p'
  380 | int b0p = b0p + 0; // ” in C++ 2014
      |                 ^
p1777.cpp:379:5: note: previous declaration 'int D::b0p'
  379 | int b0p = F(0p+0); // ill-formed; equivalent to “
      |     ^~~
p1777.cpp:399:1: error: non-static data member declared with placeholder 'auto'
  399 | auto x1{1}; // was std::initializer_list<int>, now int
      | ^~~~
p1777.cpp:400:1: error: non-static data member declared with placeholder 'auto'
  400 | auto x2{1, 2}; // was std::initializer_list<int>, now ill-formed
      | ^~~~
p1777.cpp:413:13: error: redefinition of 'struct D::base'
  413 |      struct base {
      |             ^~~~
p1777.cpp:233:13: note: previous definition of 'struct D::base'
  233 |      struct base {
      |             ^~~~
p1777.cpp:417:13: error: redefinition of 'struct D::derived'
  417 |      struct derived : base {};
      |             ^~~~~~~
p1777.cpp:239:8: note: previous definition of 'struct D::derived'
  239 | struct derived : base {};
      |        ^~~~~~~
p1777.cpp:426:8: error: redefinition of 'struct D::A'
  426 | struct A {
      |        ^
p1777.cpp:177:8: note: previous definition of 'struct D::A'
  177 | struct A {
      |        ^
p1777.cpp:430:8: error: redefinition of 'struct D::B'
  430 | struct B : A {
      |        ^
p1777.cpp:180:8: note: previous definition of 'struct D::B'
  180 | struct B {
      |        ^
p1777.cpp:433:5: error: expected identifier before numeric constant
  433 | B b(42L);
      |     ^~~
p1777.cpp:433:5: error: expected ',' or '...' before numeric constant
p1777.cpp:433:8: error: 'D::B D::b(int)' conflicts with a previous declaration
  433 | B b(42L);
      |        ^
p1777.cpp:191:3: note: previous declaration 'D::B D::b'
  191 | B b = {1};
      |   ^
p1777.cpp:439:27: error: 'D::A' is not a template
  439 |   template <int N> struct A;
      |                           ^
p1777.cpp:177:8: note: previous declaration here
  177 | struct A {
      |        ^
p1777.cpp:440:38: error: 'D::A' is not a template
  440 |   template <typename T, T N> int foo(A<N> *) = delete;
      |                                      ^
p1777.cpp:442:12: error: 'D::A' is not a template
  442 |   void bar(A<0> *p) {
      |            ^
p1777.cpp:1132:2: error: expected '}' at end of input
 1132 | }
      |  ^
p1777.cpp:63:24: note: to match this '{'
   63 |   struct D : private B {
      |                        ^
p1777.cpp:120:19: error: could not convert '"text"' from 'const char8_t [5]' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
  120 |   std::string s = u8"text";
      |                   ^~~~~~~~
      |                   |
      |                   const char8_t [5]
p1777.cpp:190:5: error: use of deleted function 'D::A::A()'
  190 | A a{};
      |     ^
p1777.cpp:178:3: note: declared here
  178 |   A() = delete;
      |   ^
p1777.cpp:191:9: error: could not convert '{1}' from '<brace-enclosed initializer list>' to 'D::B'
  191 | B b = {1};
      |         ^
      |         |
      |         <brace-enclosed initializer list>
p1777.cpp:209:6: error: initializer for flexible array member 'bool D::y []'
  209 | bool y[] = { "bc" }; // ill-formed; previously well-formed
      |      ^
p1777.cpp:378:14: error: cannot convert 'D::B' to 'int' in initialization
  378 | #define F(a) b ## a
      |              ^
      |              |
      |              D::B
p1777.cpp:379:11: note: in expansion of macro 'F'
  379 | int b0p = F(0p+0); // ill-formed; equivalent to “
      |           ^
p1777.cpp:379:13: error: expected ';' before numeric constant
  379 | int b0p = F(0p+0); // ill-formed; equivalent to “
      |             ^~~~
p1777.cpp:378:19: note: in definition of macro 'F'
  378 | #define F(a) b ## a
      |                   ^
p1777.cpp:408:11: error: invalid use of non-static member function 'void D::g1()'
  408 | int x = f(g1, g2); // ill-formed; previously well-formed
      |           ^~
p1777.cpp:405:6: note: declared here
  405 | void g1() noexcept;
      |      ^~
p1777.cpp: In member function 'void D::f(int)':
p1777.cpp:65:8: error: no matching function for call to 'std::__cxx11::basic_string<char>::erase(D&)'
   65 | s.erase(*this); // ill formed; previously well-formed }
      | ~~~~~~~^~~~~~~
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,
                 from /usr/local/include/c++/12.1.0/iostream:39:
/usr/local/include/c++/12.1.0/bits/basic_string.h:2032:7: note: candidate: 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 2032 |       erase(size_type __pos = 0, size_type __n = npos)
      |       ^~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:2032:23: note:   no known conversion for argument 1 from 'D' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
 2032 |       erase(size_type __pos = 0, size_type __n = npos)
      |             ~~~~~~~~~~^~~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:2052:7: note: candidate: 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]'
 2052 |       erase(__const_iterator __position)
      |       ^~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:2052:30: note:   no known conversion for argument 1 from 'D' to 'std::__cxx11::basic_string<char>::__const_iterato' {aka 'std::__cxx11::basic_string<char>::const_iterator'}
 2052 |       erase(__const_iterator __position)
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:2072:7: note: candidate: 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator, __const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]'
 2072 |       erase(__const_iterator __first, __const_iterator __last)
      |       ^~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:2072:7: note:   candidate expects 2 arguments, 1 provided
p1777.cpp: In member function 'int D::g()':
p1777.cpp:167:19: error: cannot convert 'D::import' to 'int' in return
  167 | int g() { return f(); }
      |                  ~^~
      |                   |
      |                   D::import
p1777.cpp: In member function 'D::base D::f(base)':
p1777.cpp:241:9: error: 'D::base::base(D::base&&)' is private within this context
  241 |   throw b;
      |         ^
p1777.cpp:237:3: note: declared private here
  237 |   base(base &&);
      |   ^~~~
p1777.cpp:243:10: error: 'D::base::base(D::base&&)' is private within this context
  243 |   return d;
      |          ^
p1777.cpp:237:3: note: declared private here
  237 |   base(base &&);
      |   ^~~~
p1777.cpp: In member function 'void D::g()':
p1777.cpp:254:13: error: too many initializers for 'D::S'
  254 |   S s("text");
      |             ^
p1777.cpp:256:15: error: 'struct D::S' has no member named 'm'
  256 |   char c = *s.m;
      |               ^
p1777.cpp:256:8: warning: unused variable 'c' [-Wunused-variable]
  256 |   char c = *s.m;
      |        ^
p1777.cpp: In member function 'int D::check(A, A)':
p1777.cpp:272:15: error: no match for 'operator==' (operand types are 'D::A' and 'D::A')
  272 |     return (x == y) +
      |             ~ ^~ ~
      |             |    |
      |             D::A D::A
In file included from /usr/local/include/c++/12.1.0/string:41:
/usr/local/include/c++/12.1.0/bits/allocator.h:214:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' (reversed)
  214 |     operator==(const allocator<_T1>&, const allocator<_T2>&)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/allocator.h:214:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::allocator<_CharT>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/string:47:
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:530:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_IteratorL>&, const reverse_iterator<_IteratorR>&) requires requires{{std::operator==::__x->base() == std::operator==::__y->base()} -> decltype(auto) [requires std::convertible_to<<placeholder>, bool>];}' (reversed)
  530 |     operator==(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:530:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::reverse_iterator<_IteratorL>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:1656:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&) requires requires{{std::operator==::__x->base() == std::operator==::__y->base()} -> decltype(auto) [requires std::convertible_to<<placeholder>, bool>];}' (reversed)
 1656 |     operator==(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:1656:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::move_iterator<_IteratorL>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/bits/basic_string.h:48:
/usr/local/include/c++/12.1.0/string_view:546:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' (reversed)
  546 |     operator==(basic_string_view<_CharT, _Traits> __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/string_view:546:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'std::basic_string_view<_CharT, _Traits>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3599:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> constexpr bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' (reversed)
 3599 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3599:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
  272 |     return (x == y) +
      |                  ^
In file included from N4910.h:9:
/usr/local/include/c++/12.1.0/complex:469:5: note: candidate: 'template<class _Tp> constexpr bool std::operator==(const complex<_Tp>&, const _Tp&)' (reversed)
  469 |     operator==(const complex<_Tp>& __x, const _Tp& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/complex:469:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::complex<_Tp>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/bits/stl_map.h:63,
                 from /usr/local/include/c++/12.1.0/map:61,
                 from N4910.h:10:
/usr/local/include/c++/12.1.0/tuple:1496:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_Args1 ...>&, const tuple<_Args2 ...>&)' (reversed)
 1496 |     operator==(const tuple<_TElements...>& __t,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/tuple:1496:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::tuple<_Args1 ...>'
  272 |     return (x == y) +
      |                  ^
In file included from N4910.h:13:
/usr/local/include/c++/12.1.0/optional:1222:5: note: candidate: 'template<class _Tp, class _Up> constexpr std::__optional_eq_t<_Tp, _Up> std::operator==(const optional<_Tp>&, const optional<_Up>&)' (reversed)
 1222 |     operator==(const optional<_Tp>& __lhs, const optional<_Up>& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/optional:1222:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::optional<_Tp>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/optional:1282:5: note: candidate: 'template<class _Tp> constexpr bool std::operator==(const optional<_Tp>&, nullopt_t)' (reversed)
 1282 |     operator==(const optional<_Tp>& __lhs, nullopt_t) noexcept
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/optional:1282:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::optional<_Tp>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/optional:1350:5: note: candidate: 'template<class _Tp, class _Up> constexpr std::__optional_eq_t<_Tp, _Up> std::operator==(const optional<_Tp>&, const _Up&)' (reversed)
 1350 |     operator==(const optional<_Tp>& __lhs, const _Up& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/optional:1350:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::optional<_Tp>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/optional:1356:5: note: candidate: 'template<class _Tp, class _Up> constexpr std::__optional_eq_t<_Up, _Tp> std::operator==(const _Up&, const optional<_Tp>&)' (reversed)
 1356 |     operator==(const _Up& __lhs, const optional<_Tp>& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/optional:1356:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::optional<_Tp>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/memory:76,
                 from N4910.h:14:
/usr/local/include/c++/12.1.0/bits/unique_ptr.h:824:5: note: candidate: 'template<class _Tp, class _Dp, class _Up, class _Ep> constexpr bool std::operator==(const unique_ptr<_Tp, _Dp>&, const unique_ptr<_Up, _Ep>&)' (reversed)
  824 |     operator==(const unique_ptr<_Tp, _Dp>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/unique_ptr.h:824:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::unique_ptr<_Tp, _Dp>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/unique_ptr.h:832:5: note: candidate: 'template<class _Tp, class _Dp> constexpr bool std::operator==(const unique_ptr<_Tp, _Dp>&, nullptr_t)' (reversed)
  832 |     operator==(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/unique_ptr.h:832:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::unique_ptr<_Tp, _Dp>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/bits/shared_ptr.h:53,
                 from /usr/local/include/c++/12.1.0/memory:77:
/usr/local/include/c++/12.1.0/bits/shared_ptr_base.h:1793:5: note: candidate: 'template<class _Tp1, class _Tp2, __gnu_cxx::_Lock_policy _Lp> bool std::operator==(const __shared_ptr<_Tp1, _Lp>&, const __shared_ptr<_Tp2, _Lp>&)' (reversed)
 1793 |     operator==(const __shared_ptr<_Tp1, _Lp>& __a,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr_base.h:1793:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::__shared_ptr<_Tp1, _Lp>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/shared_ptr_base.h:1799:5: note: candidate: 'template<class _Tp, __gnu_cxx::_Lock_policy _Lp> bool std::operator==(const __shared_ptr<_Tp, _Lp>&, nullptr_t)' (reversed)
 1799 |     operator==(const __shared_ptr<_Tp, _Lp>& __a, nullptr_t) noexcept
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr_base.h:1799:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::__shared_ptr<_Tp, _Lp>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:555:5: note: candidate: 'template<class _Tp, class _Up> bool std::operator==(const shared_ptr<_Tp>&, const shared_ptr<_Tp>&)' (reversed)
  555 |     operator==(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:555:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::shared_ptr<_Tp>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:561:5: note: candidate: 'template<class _Tp> bool std::operator==(const shared_ptr<_Tp>&, nullptr_t)' (reversed)
  561 |     operator==(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:561:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::shared_ptr<_Tp>'
  272 |     return (x == y) +
      |                  ^
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:368:3: note: candidate: 'bool std::operator==(const error_code&, const error_condition&)' (reversed)
  368 |   operator==(const error_code& __lhs, const error_condition& __rhs) noexcept
      |   ^~~~~~~~
/usr/local/include/c++/12.1.0/system_error:368:32: note:   no known conversion for argument 1 from 'D::A' to 'const std::error_code&'
  368 |   operator==(const error_code& __lhs, const error_condition& __rhs) noexcept
      |              ~~~~~~~~~~~~~~~~~~^~~~~
In file included from /usr/local/include/c++/12.1.0/iosfwd:40,
                 from /usr/local/include/c++/12.1.0/ios:38:
/usr/local/include/c++/12.1.0/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
  192 |     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/postypes.h:192:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::fpos<_StateT>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:589:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_IteratorL>&, const reverse_iterator<_IteratorL>&) requires requires{{std::operator==::__x->base() == std::operator==::__y->base()} -> decltype(auto) [requires std::convertible_to<<placeholder>, bool>];}'
  589 |     operator==(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:589:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::reverse_iterator<_IteratorL>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:1726:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1726 |     operator==(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:1726:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::move_iterator<_IteratorL>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/bits/stl_algobase.h:64,
                 from /usr/local/include/c++/12.1.0/string:50:
/usr/local/include/c++/12.1.0/bits/stl_pair.h:640:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
  640 |     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_pair.h:640:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::pair<_T1, _T2>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/string_view:540:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
  540 |     operator==(basic_string_view<_CharT, _Traits> __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/string_view:540:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'std::basic_string_view<_CharT, _Traits>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3575:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> constexpr bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 3575 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3575:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3584:5: note: candidate: 'template<class _CharT> constexpr typename __gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, bool>::__type std::operator==(const __cxx11::basic_string<_CharT>&, const __cxx11::basic_string<_CharT>&)'
 3584 |     operator==(const basic_string<_CharT>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3584:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::__cxx11::basic_string<_CharT>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/bits/locale_facets.h:48,
                 from /usr/local/include/c++/12.1.0/bits/basic_ios.h:37,
                 from /usr/local/include/c++/12.1.0/ios:44:
/usr/local/include/c++/12.1.0/bits/streambuf_iterator.h:233:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)'
  233 |     operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/streambuf_iterator.h:233:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/vector:64,
                 from N4910.h:8:
/usr/local/include/c++/12.1.0/bits/stl_vector.h:2035:5: note: candidate: 'template<class _Tp, class _Alloc> constexpr bool std::operator==(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
 2035 |     operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_vector.h:2035:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::vector<_Tp, _Alloc>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/complex:464:5: note: candidate: 'template<class _Tp> constexpr bool std::operator==(const complex<_Tp>&, const complex<_Tp>&)'
  464 |     operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/complex:464:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::complex<_Tp>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/stl_map.h:1511:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator==(const map<_Key, _Tp, _Compare, _Allocator>&, const map<_Key, _Tp, _Compare, _Allocator>&)'
 1511 |     operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_map.h:1511:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::map<_Key, _Tp, _Compare, _Allocator>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/map:62:
/usr/local/include/c++/12.1.0/bits/stl_multimap.h:1132:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator==(const multimap<_Key, _Tp, _Compare, _Allocator>&, const multimap<_Key, _Tp, _Compare, _Allocator>&)'
 1132 |     operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_multimap.h:1132:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::multimap<_Key, _Tp, _Compare, _Allocator>'
  272 |     return (x == y) +
      |                  ^
In file included from /usr/local/include/c++/12.1.0/unordered_map:47,
                 from N4910.h:12:
/usr/local/include/c++/12.1.0/bits/unordered_map.h:2134:5: note: candidate: 'template<class _Key1, class _Tp1, class _Hash1, class _Pred1, class _Alloc1> bool std::operator==(const unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&, const unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&)'
 2134 |     operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/unordered_map.h:2134:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>'
  272 |     return (x == y) +
      |                  ^
/usr/local/include/c++/12.1.0/bits/unordered_map.h:2148:5: note: candidate: 'template<class _Key1, class _Tp1, class _Hash1, class _Pred1, class _Alloc1> bool std::operator==(const unordered_multimap<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&, const unordered_multimap<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&)'
 2148 |     operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/unordered_map.h:2148:5: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::unordered_multimap<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>'
  272 |     return (x == y) +
      |                  ^
In file included from N4910.h:15:
/usr/local/include/c++/12.1.0/variant:1241:3: note: candidate: 'template<class ... _Types> constexpr bool std::operator==(const variant<_Types ...>&, const variant<_Types ...>&)'
 1241 |   _VARIANT_RELATION_FUNCTION_TEMPLATE(==, equal)
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/variant:1241:3: note:   template argument deduction/substitution failed:
p1777.cpp:272:18: note:   'D::A' is not derived from 'const std::variant<_Types ...>'
  272 |     return (x == y) +
      |                  ^
In file included from N4910.h:7:
/usr/local/include/c++/12.1.0/coroutine:146:3: note: candidate: 'constexpr bool std::__n4861::operator==(coroutine_handle<void>, coroutine_handle<void>)'
  146 |   operator==(coroutine_handle<> __a, coroutine_handle<> __b) noexcept
      |   ^~~~~~~~
/usr/local/include/c++/12.1.0/coroutine:146:33: note:   no known conversion for argument 1 from 'D::A' to 'std::__n4861::coroutine_handle<void>'
  146 |   operator==(coroutine_handle<> __a, coroutine_handle<> __b) noexcept
      |              ~~~~~~~~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/system_error:362:3: note: candidate: 'bool std::operator==(const error_code&, const error_code&)'
  362 |   operator==(const error_code& __lhs, const error_code& __rhs) noexcept
      |   ^~~~~~~~
/usr/local/include/c++/12.1.0/system_error:362:32: note:   no known conversion for argument 1 from 'D::A' to 'const std::error_code&'
  362 |   operator==(const error_code& __lhs, const error_code& __rhs) noexcept
      |              ~~~~~~~~~~~~~~~~~~^~~~~
/usr/local/include/c++/12.1.0/system_error:376:3: note: candidate: 'bool std::operator==(const error_condition&, const error_condition&)'
  376 |   operator==(const error_condition& __lhs,
      |   ^~~~~~~~
/usr/local/include/c++/12.1.0/system_error:376:37: note:   no known conversion for argument 1 from 'D::A' to 'const std::error_condition&'
  376 |   operator==(const error_condition& __lhs,
      |              ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/local/include/c++/12.1.0/variant:1248:18: note: candidate: 'constexpr bool std::operator==(monostate, monostate)'
 1248 |   constexpr bool operator==(monostate, monostate) noexcept { return true; }
      |                  ^~~~~~~~
/usr/local/include/c++/12.1.0/variant:1248:29: note:   no known conversion for argument 1 from 'D::A' to 'std::monostate'
 1248 |   constexpr bool operator==(monostate, monostate) noexcept { return true; }
      |                             ^~~~~~~~~
p1777.cpp:273:11: error: no match for 'operator==' (operand types are 'int' and 'D::A')
  273 |       (10 == x) +
      |        ~~ ^~ ~
      |        |     |
      |        int   D::A
/usr/local/include/c++/12.1.0/bits/allocator.h:214:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' (reversed)
  214 |     operator==(const allocator<_T1>&, const allocator<_T2>&)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/allocator.h:214:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::allocator<_CharT>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:530:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_IteratorL>&, const reverse_iterator<_IteratorR>&) requires requires{{std::operator==::__x->base() == std::operator==::__y->base()} -> decltype(auto) [requires std::convertible_to<<placeholder>, bool>];}' (reversed)
  530 |     operator==(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:530:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::reverse_iterator<_IteratorL>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:1656:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&) requires requires{{std::operator==::__x->base() == std::operator==::__y->base()} -> decltype(auto) [requires std::convertible_to<<placeholder>, bool>];}' (reversed)
 1656 |     operator==(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:1656:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::move_iterator<_IteratorL>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/string_view:546:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' (reversed)
  546 |     operator==(basic_string_view<_CharT, _Traits> __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/string_view:546:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'std::basic_string_view<_CharT, _Traits>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3599:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> constexpr bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' (reversed)
 3599 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3599:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/complex:469:5: note: candidate: 'template<class _Tp> constexpr bool std::operator==(const complex<_Tp>&, const _Tp&)' (reversed)
  469 |     operator==(const complex<_Tp>& __x, const _Tp& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/complex:469:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::complex<_Tp>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/tuple:1496:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_Args1 ...>&, const tuple<_Args2 ...>&)' (reversed)
 1496 |     operator==(const tuple<_TElements...>& __t,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/tuple:1496:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::tuple<_Args1 ...>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/optional:1222:5: note: candidate: 'template<class _Tp, class _Up> constexpr std::__optional_eq_t<_Tp, _Up> std::operator==(const optional<_Tp>&, const optional<_Up>&)' (reversed)
 1222 |     operator==(const optional<_Tp>& __lhs, const optional<_Up>& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/optional:1222:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::optional<_Tp>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/optional:1282:5: note: candidate: 'template<class _Tp> constexpr bool std::operator==(const optional<_Tp>&, nullopt_t)' (reversed)
 1282 |     operator==(const optional<_Tp>& __lhs, nullopt_t) noexcept
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/optional:1282:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::optional<_Tp>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/optional:1350:5: note: candidate: 'template<class _Tp, class _Up> constexpr std::__optional_eq_t<_Tp, _Up> std::operator==(const optional<_Tp>&, const _Up&)' (reversed)
 1350 |     operator==(const optional<_Tp>& __lhs, const _Up& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/optional:1350:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::optional<_Tp>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/optional:1356:5: note: candidate: 'template<class _Tp, class _Up> constexpr std::__optional_eq_t<_Up, _Tp> std::operator==(const _Up&, const optional<_Tp>&)' (reversed)
 1356 |     operator==(const _Up& __lhs, const optional<_Tp>& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/optional:1356:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::optional<_Tp>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/unique_ptr.h:824:5: note: candidate: 'template<class _Tp, class _Dp, class _Up, class _Ep> constexpr bool std::operator==(const unique_ptr<_Tp, _Dp>&, const unique_ptr<_Up, _Ep>&)' (reversed)
  824 |     operator==(const unique_ptr<_Tp, _Dp>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/unique_ptr.h:824:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::unique_ptr<_Tp, _Dp>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/unique_ptr.h:832:5: note: candidate: 'template<class _Tp, class _Dp> constexpr bool std::operator==(const unique_ptr<_Tp, _Dp>&, nullptr_t)' (reversed)
  832 |     operator==(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/unique_ptr.h:832:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::unique_ptr<_Tp, _Dp>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/shared_ptr_base.h:1793:5: note: candidate: 'template<class _Tp1, class _Tp2, __gnu_cxx::_Lock_policy _Lp> bool std::operator==(const __shared_ptr<_Tp1, _Lp>&, const __shared_ptr<_Tp2, _Lp>&)' (reversed)
 1793 |     operator==(const __shared_ptr<_Tp1, _Lp>& __a,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr_base.h:1793:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::__shared_ptr<_Tp1, _Lp>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/shared_ptr_base.h:1799:5: note: candidate: 'template<class _Tp, __gnu_cxx::_Lock_policy _Lp> bool std::operator==(const __shared_ptr<_Tp, _Lp>&, nullptr_t)' (reversed)
 1799 |     operator==(const __shared_ptr<_Tp, _Lp>& __a, nullptr_t) noexcept
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr_base.h:1799:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::__shared_ptr<_Tp, _Lp>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:555:5: note: candidate: 'template<class _Tp, class _Up> bool std::operator==(const shared_ptr<_Tp>&, const shared_ptr<_Tp>&)' (reversed)
  555 |     operator==(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:555:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::shared_ptr<_Tp>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:561:5: note: candidate: 'template<class _Tp> bool std::operator==(const shared_ptr<_Tp>&, nullptr_t)' (reversed)
  561 |     operator==(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:561:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   'D::A' is not derived from 'const std::shared_ptr<_Tp>'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/system_error:368:3: note: candidate: 'bool std::operator==(const error_code&, const error_condition&)' (reversed)
  368 |   operator==(const error_code& __lhs, const error_condition& __rhs) noexcept
      |   ^~~~~~~~
/usr/local/include/c++/12.1.0/system_error:368:32: note:   no known conversion for argument 1 from 'D::A' to 'const std::error_code&'
  368 |   operator==(const error_code& __lhs, const error_condition& __rhs) noexcept
      |              ~~~~~~~~~~~~~~~~~~^~~~~
/usr/local/include/c++/12.1.0/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
  192 |     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/postypes.h:192:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::fpos<_StateT>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:589:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_IteratorL>&, const reverse_iterator<_IteratorL>&) requires requires{{std::operator==::__x->base() == std::operator==::__y->base()} -> decltype(auto) [requires std::convertible_to<<placeholder>, bool>];}'
  589 |     operator==(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:589:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::reverse_iterator<_IteratorL>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:1726:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1726 |     operator==(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:1726:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_pair.h:640:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
  640 |     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_pair.h:640:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::pair<_T1, _T2>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/string_view:540:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
  540 |     operator==(basic_string_view<_CharT, _Traits> __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/string_view:540:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3575:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> constexpr bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 3575 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3575:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3584:5: note: candidate: 'template<class _CharT> constexpr typename __gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, bool>::__type std::operator==(const __cxx11::basic_string<_CharT>&, const __cxx11::basic_string<_CharT>&)'
 3584 |     operator==(const basic_string<_CharT>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3584:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::__cxx11::basic_string<_CharT>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/streambuf_iterator.h:233:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)'
  233 |     operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/streambuf_iterator.h:233:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::istreambuf_iterator<_CharT, _Traits>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_vector.h:2035:5: note: candidate: 'template<class _Tp, class _Alloc> constexpr bool std::operator==(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
 2035 |     operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_vector.h:2035:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/complex:464:5: note: candidate: 'template<class _Tp> constexpr bool std::operator==(const complex<_Tp>&, const complex<_Tp>&)'
  464 |     operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/complex:464:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::complex<_Tp>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_map.h:1511:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator==(const map<_Key, _Tp, _Compare, _Allocator>&, const map<_Key, _Tp, _Compare, _Allocator>&)'
 1511 |     operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_map.h:1511:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::map<_Key, _Tp, _Compare, _Allocator>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_multimap.h:1132:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator==(const multimap<_Key, _Tp, _Compare, _Allocator>&, const multimap<_Key, _Tp, _Compare, _Allocator>&)'
 1132 |     operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_multimap.h:1132:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::multimap<_Key, _Tp, _Compare, _Allocator>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/unordered_map.h:2134:5: note: candidate: 'template<class _Key1, class _Tp1, class _Hash1, class _Pred1, class _Alloc1> bool std::operator==(const unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&, const unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&)'
 2134 |     operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/unordered_map.h:2134:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/bits/unordered_map.h:2148:5: note: candidate: 'template<class _Key1, class _Tp1, class _Hash1, class _Pred1, class _Alloc1> bool std::operator==(const unordered_multimap<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&, const unordered_multimap<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&)'
 2148 |     operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/unordered_map.h:2148:5: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::unordered_multimap<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/variant:1241:3: note: candidate: 'template<class ... _Types> constexpr bool std::operator==(const variant<_Types ...>&, const variant<_Types ...>&)'
 1241 |   _VARIANT_RELATION_FUNCTION_TEMPLATE(==, equal)
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/variant:1241:3: note:   template argument deduction/substitution failed:
p1777.cpp:273:14: note:   mismatched types 'const std::variant<_Types ...>' and 'int'
  273 |       (10 == x) +
      |              ^
/usr/local/include/c++/12.1.0/coroutine:146:3: note: candidate: 'constexpr bool std::__n4861::operator==(coroutine_handle<void>, coroutine_handle<void>)'
  146 |   operator==(coroutine_handle<> __a, coroutine_handle<> __b) noexcept
      |   ^~~~~~~~
/usr/local/include/c++/12.1.0/coroutine:146:33: note:   no known conversion for argument 1 from 'int' to 'std::__n4861::coroutine_handle<void>'
  146 |   operator==(coroutine_handle<> __a, coroutine_handle<> __b) noexcept
      |              ~~~~~~~~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/system_error:362:3: note: candidate: 'bool std::operator==(const error_code&, const error_code&)'
  362 |   operator==(const error_code& __lhs, const error_code& __rhs) noexcept
      |   ^~~~~~~~
/usr/local/include/c++/12.1.0/system_error:362:32: note:   no known conversion for argument 1 from 'int' to 'const std::error_code&'
  362 |   operator==(const error_code& __lhs, const error_code& __rhs) noexcept
      |              ~~~~~~~~~~~~~~~~~~^~~~~
/usr/local/include/c++/12.1.0/system_error:376:3: note: candidate: 'bool std::operator==(const error_condition&, const error_condition&)'
  376 |   operator==(const error_condition& __lhs,
      |   ^~~~~~~~
/usr/local/include/c++/12.1.0/system_error:376:37: note:   no known conversion for argument 1 from 'int' to 'const std::error_condition&'
  376 |   operator==(const error_condition& __lhs,
      |              ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/local/include/c++/12.1.0/variant:1248:18: note: candidate: 'constexpr bool std::operator==(monostate, monostate)'
 1248 |   constexpr bool operator==(monostate, monostate) noexcept { return true; }
      |                  ^~~~~~~~
/usr/local/include/c++/12.1.0/variant:1248:29: note:   no known conversion for argument 1 from 'int' to 'std::monostate'
 1248 |   constexpr bool operator==(monostate, monostate) noexcept { return true; }
      |                             ^~~~~~~~~
p1777.cpp:274:11: error: no match for 'operator!=' (operand types are 'int' and 'D::A')
  274 |       (10 != x);
      |        ~~ ^~ ~
      |        |     |
      |        int   D::A
/usr/local/include/c++/12.1.0/bits/allocator.h:214:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' (reversed)
  214 |     operator==(const allocator<_T1>&, const allocator<_T2>&)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/allocator.h:214:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::allocator<_CharT>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:530:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_IteratorL>&, const reverse_iterator<_IteratorR>&) requires requires{{std::operator==::__x->base() == std::operator==::__y->base()} -> decltype(auto) [requires std::convertible_to<<placeholder>, bool>];}' (reversed)
  530 |     operator==(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:530:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::reverse_iterator<_IteratorL>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:1656:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&) requires requires{{std::operator==::__x->base() == std::operator==::__y->base()} -> decltype(auto) [requires std::convertible_to<<placeholder>, bool>];}' (reversed)
 1656 |     operator==(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:1656:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::move_iterator<_IteratorL>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/string_view:546:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' (reversed)
  546 |     operator==(basic_string_view<_CharT, _Traits> __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/string_view:546:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'std::basic_string_view<_CharT, _Traits>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3599:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> constexpr bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' (reversed)
 3599 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3599:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/complex:469:5: note: candidate: 'template<class _Tp> constexpr bool std::operator==(const complex<_Tp>&, const _Tp&)' (reversed)
  469 |     operator==(const complex<_Tp>& __x, const _Tp& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/complex:469:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::complex<_Tp>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/tuple:1496:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_Args1 ...>&, const tuple<_Args2 ...>&)' (reversed)
 1496 |     operator==(const tuple<_TElements...>& __t,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/tuple:1496:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::tuple<_Args1 ...>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/optional:1222:5: note: candidate: 'template<class _Tp, class _Up> constexpr std::__optional_eq_t<_Tp, _Up> std::operator==(const optional<_Tp>&, const optional<_Up>&)' (reversed)
 1222 |     operator==(const optional<_Tp>& __lhs, const optional<_Up>& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/optional:1222:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::optional<_Tp>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/optional:1282:5: note: candidate: 'template<class _Tp> constexpr bool std::operator==(const optional<_Tp>&, nullopt_t)' (reversed)
 1282 |     operator==(const optional<_Tp>& __lhs, nullopt_t) noexcept
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/optional:1282:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::optional<_Tp>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/optional:1350:5: note: candidate: 'template<class _Tp, class _Up> constexpr std::__optional_eq_t<_Tp, _Up> std::operator==(const optional<_Tp>&, const _Up&)' (reversed)
 1350 |     operator==(const optional<_Tp>& __lhs, const _Up& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/optional:1350:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::optional<_Tp>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/optional:1356:5: note: candidate: 'template<class _Tp, class _Up> constexpr std::__optional_eq_t<_Up, _Tp> std::operator==(const _Up&, const optional<_Tp>&)' (reversed)
 1356 |     operator==(const _Up& __lhs, const optional<_Tp>& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/optional:1356:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::optional<_Tp>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/unique_ptr.h:824:5: note: candidate: 'template<class _Tp, class _Dp, class _Up, class _Ep> constexpr bool std::operator==(const unique_ptr<_Tp, _Dp>&, const unique_ptr<_Up, _Ep>&)' (reversed)
  824 |     operator==(const unique_ptr<_Tp, _Dp>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/unique_ptr.h:824:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::unique_ptr<_Tp, _Dp>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/unique_ptr.h:832:5: note: candidate: 'template<class _Tp, class _Dp> constexpr bool std::operator==(const unique_ptr<_Tp, _Dp>&, nullptr_t)' (reversed)
  832 |     operator==(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/unique_ptr.h:832:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::unique_ptr<_Tp, _Dp>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/shared_ptr_base.h:1793:5: note: candidate: 'template<class _Tp1, class _Tp2, __gnu_cxx::_Lock_policy _Lp> bool std::operator==(const __shared_ptr<_Tp1, _Lp>&, const __shared_ptr<_Tp2, _Lp>&)' (reversed)
 1793 |     operator==(const __shared_ptr<_Tp1, _Lp>& __a,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr_base.h:1793:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::__shared_ptr<_Tp1, _Lp>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/shared_ptr_base.h:1799:5: note: candidate: 'template<class _Tp, __gnu_cxx::_Lock_policy _Lp> bool std::operator==(const __shared_ptr<_Tp, _Lp>&, nullptr_t)' (reversed)
 1799 |     operator==(const __shared_ptr<_Tp, _Lp>& __a, nullptr_t) noexcept
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr_base.h:1799:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::__shared_ptr<_Tp, _Lp>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:555:5: note: candidate: 'template<class _Tp, class _Up> bool std::operator==(const shared_ptr<_Tp>&, const shared_ptr<_Tp>&)' (reversed)
  555 |     operator==(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:555:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::shared_ptr<_Tp>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:561:5: note: candidate: 'template<class _Tp> bool std::operator==(const shared_ptr<_Tp>&, nullptr_t)' (reversed)
  561 |     operator==(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:561:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::shared_ptr<_Tp>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/system_error:368:3: note: candidate: 'bool std::operator==(const error_code&, const error_condition&)' (reversed)
  368 |   operator==(const error_code& __lhs, const error_condition& __rhs) noexcept
      |   ^~~~~~~~
/usr/local/include/c++/12.1.0/system_error:368:32: note:   no known conversion for argument 1 from 'D::A' to 'const std::error_code&'
  368 |   operator==(const error_code& __lhs, const error_condition& __rhs) noexcept
      |              ~~~~~~~~~~~~~~~~~~^~~~~
/usr/local/include/c++/12.1.0/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' (rewritten)
  192 |     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/postypes.h:192:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::fpos<_StateT>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:589:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_IteratorL>&, const reverse_iterator<_IteratorL>&) requires requires{{std::operator==::__x->base() == std::operator==::__y->base()} -> decltype(auto) [requires std::convertible_to<<placeholder>, bool>];}' (rewritten)
  589 |     operator==(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:589:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::reverse_iterator<_IteratorL>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:1726:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' (rewritten)
 1726 |     operator==(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:1726:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_pair.h:640:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' (rewritten)
  640 |     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_pair.h:640:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::pair<_T1, _T2>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/string_view:540:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' (rewritten)
  540 |     operator==(basic_string_view<_CharT, _Traits> __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/string_view:540:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3575:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> constexpr bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' (rewritten)
 3575 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3575:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/basic_string.h:3584:5: note: candidate: 'template<class _CharT> constexpr typename __gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, bool>::__type std::operator==(const __cxx11::basic_string<_CharT>&, const __cxx11::basic_string<_CharT>&)' (rewritten)
 3584 |     operator==(const basic_string<_CharT>& __lhs,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/basic_string.h:3584:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::__cxx11::basic_string<_CharT>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/streambuf_iterator.h:233:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' (rewritten)
  233 |     operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/streambuf_iterator.h:233:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::istreambuf_iterator<_CharT, _Traits>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_vector.h:2035:5: note: candidate: 'template<class _Tp, class _Alloc> constexpr bool std::operator==(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)' (rewritten)
 2035 |     operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_vector.h:2035:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/complex:464:5: note: candidate: 'template<class _Tp> constexpr bool std::operator==(const complex<_Tp>&, const complex<_Tp>&)' (rewritten)
  464 |     operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/complex:464:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::complex<_Tp>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_map.h:1511:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator==(const map<_Key, _Tp, _Compare, _Allocator>&, const map<_Key, _Tp, _Compare, _Allocator>&)' (rewritten)
 1511 |     operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_map.h:1511:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::map<_Key, _Tp, _Compare, _Allocator>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_multimap.h:1132:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator==(const multimap<_Key, _Tp, _Compare, _Allocator>&, const multimap<_Key, _Tp, _Compare, _Allocator>&)' (rewritten)
 1132 |     operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_multimap.h:1132:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::multimap<_Key, _Tp, _Compare, _Allocator>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/unordered_map.h:2134:5: note: candidate: 'template<class _Key1, class _Tp1, class _Hash1, class _Pred1, class _Alloc1> bool std::operator==(const unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&, const unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&)' (rewritten)
 2134 |     operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/unordered_map.h:2134:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/unordered_map.h:2148:5: note: candidate: 'template<class _Key1, class _Tp1, class _Hash1, class _Pred1, class _Alloc1> bool std::operator==(const unordered_multimap<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&, const unordered_multimap<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&)' (rewritten)
 2148 |     operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/unordered_map.h:2148:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::unordered_multimap<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/variant:1241:3: note: candidate: 'template<class ... _Types> constexpr bool std::operator==(const variant<_Types ...>&, const variant<_Types ...>&)' (rewritten)
 1241 |   _VARIANT_RELATION_FUNCTION_TEMPLATE(==, equal)
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/variant:1241:3: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::variant<_Types ...>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/coroutine:146:3: note: candidate: 'constexpr bool std::__n4861::operator==(coroutine_handle<void>, coroutine_handle<void>)' (rewritten)
  146 |   operator==(coroutine_handle<> __a, coroutine_handle<> __b) noexcept
      |   ^~~~~~~~
/usr/local/include/c++/12.1.0/coroutine:146:33: note:   no known conversion for argument 1 from 'int' to 'std::__n4861::coroutine_handle<void>'
  146 |   operator==(coroutine_handle<> __a, coroutine_handle<> __b) noexcept
      |              ~~~~~~~~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/system_error:362:3: note: candidate: 'bool std::operator==(const error_code&, const error_code&)' (rewritten)
  362 |   operator==(const error_code& __lhs, const error_code& __rhs) noexcept
      |   ^~~~~~~~
/usr/local/include/c++/12.1.0/system_error:362:32: note:   no known conversion for argument 1 from 'int' to 'const std::error_code&'
  362 |   operator==(const error_code& __lhs, const error_code& __rhs) noexcept
      |              ~~~~~~~~~~~~~~~~~~^~~~~
/usr/local/include/c++/12.1.0/system_error:376:3: note: candidate: 'bool std::operator==(const error_condition&, const error_condition&)' (rewritten)
  376 |   operator==(const error_condition& __lhs,
      |   ^~~~~~~~
/usr/local/include/c++/12.1.0/system_error:376:37: note:   no known conversion for argument 1 from 'int' to 'const std::error_condition&'
  376 |   operator==(const error_condition& __lhs,
      |              ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/local/include/c++/12.1.0/variant:1248:18: note: candidate: 'constexpr bool std::operator==(monostate, monostate)' (rewritten)
 1248 |   constexpr bool operator==(monostate, monostate) noexcept { return true; }
      |                  ^~~~~~~~
/usr/local/include/c++/12.1.0/variant:1248:29: note:   no known conversion for argument 1 from 'int' to 'std::monostate'
 1248 |   constexpr bool operator==(monostate, monostate) noexcept { return true; }
      |                             ^~~~~~~~~
/usr/local/include/c++/12.1.0/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)'
  197 |     operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/postypes.h:197:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::fpos<_StateT>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:538:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_IteratorL>&, const reverse_iterator<_IteratorR>&) requires requires{{std::operator!=::__x->base() != std::operator!=::__y->base()} -> decltype(auto) [requires std::convertible_to<<placeholder>, bool>];}'
  538 |     operator!=(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:538:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::reverse_iterator<_IteratorL>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/optional:1231:5: note: candidate: 'template<class _Tp, class _Up> constexpr std::__optional_ne_t<_Tp, _Up> std::operator!=(const optional<_Tp>&, const optional<_Up>&)'
 1231 |     operator!=(const optional<_Tp>& __lhs, const optional<_Up>& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/optional:1231:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::optional<_Tp>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/optional:1362:5: note: candidate: 'template<class _Tp, class _Up> constexpr std::__optional_ne_t<_Tp, _Up> std::operator!=(const optional<_Tp>&, const _Up&)'
 1362 |     operator!=(const optional<_Tp>& __lhs, const _Up& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/optional:1362:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::optional<_Tp>' and 'int'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/optional:1368:5: note: candidate: 'template<class _Tp, class _Up> constexpr std::__optional_ne_t<_Up, _Tp> std::operator!=(const _Up&, const optional<_Tp>&)'
 1368 |     operator!=(const _Up& __lhs, const optional<_Tp>& __rhs)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/optional:1368:5: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   'D::A' is not derived from 'const std::optional<_Tp>'
  274 |       (10 != x);
      |              ^
/usr/local/include/c++/12.1.0/variant:1242:3: note: candidate: 'template<class ... _Types> constexpr bool std::operator!=(const variant<_Types ...>&, const variant<_Types ...>&)'
 1242 |   _VARIANT_RELATION_FUNCTION_TEMPLATE(!=, not_equal)
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/variant:1242:3: note:   template argument deduction/substitution failed:
p1777.cpp:274:14: note:   mismatched types 'const std::variant<_Types ...>' and 'int'
  274 |       (10 != x);
      |              ^
p1777.cpp: In member function 'int D::main()':
p1777.cpp:286:3: error: use of deleted function 'D::A::A()'
  286 | A a;
      |   ^
p1777.cpp:178:3: note: declared here
  178 |   A() = delete;
      |   ^
p1777.cpp:287:1: error: parse error in template argument list
  287 | f < a; // ill-formed; previously well-formed (f) < a; // still well formed
      | ^~~~~
p1777.cpp:287:6: error: statement cannot resolve address of overloaded function
  287 | f < a; // ill-formed; previously well-formed (f) < a; // still well formed
      |      ^
p1777.cpp:288:1: warning: no return statement in function returning non-void [-Wreturn-type]
  288 | }
      | ^
p1777.cpp: In member function 'void D::bar(A*)':
p1777.cpp:468:42: error: no matching function for call to 'std::shared_ptr<int>::shared_ptr(std::remove_reference<std::unique_ptr<int []>&>::type)'
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |                                          ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:478:9: note: candidate: 'template<class _Alloc, class _Init> std::shared_ptr<_Tp>::shared_ptr(const std::_Sp_counted_array_base<_Alloc>&, _Init) [with _Init = _Alloc; _Tp = int]'
  478 |         shared_ptr(const _Sp_counted_array_base<_Alloc>& __a,
      |         ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:478:9: note:   template argument deduction/substitution failed:
p1777.cpp:468:42: note:   'std::remove_reference<std::unique_ptr<int []>&>::type' {aka 'std::unique_ptr<int []>'} is not derived from 'const std::_Sp_counted_array_base<_Alloc>'
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |                                          ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:463:9: note: candidate: 'template<class _Alloc, class ... _Args> std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Args = _Alloc; _Tp = int]'
  463 |         shared_ptr(_Sp_alloc_shared_tag<_Alloc> __tag, _Args&&... __args)
      |         ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:463:9: note:   template argument deduction/substitution failed:
p1777.cpp:468:42: note:   'std::unique_ptr<int []>' is not derived from 'std::_Sp_alloc_shared_tag<_Tp>'
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |                                          ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:395:9: note: candidate: 'template<class _Yp, class _Del, class> std::shared_ptr<_Tp>::shared_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Del = _Yp; <template-parameter-2-3> = _Del; _Tp = int]'
  395 |         shared_ptr(unique_ptr<_Yp, _Del>&& __r)
      |         ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:395:9: note:   template argument deduction/substitution failed:
/usr/local/include/c++/12.1.0/bits/shared_ptr.h: In substitution of 'template<class _Tp> template<class ... _Args> using _Constructible = typename std::enable_if<std::is_constructible<std::__shared_ptr<_Tp>, _Args ...>::value>::type [with _Args = {std::unique_ptr<int [], std::default_delete<int []> >}; _Tp = int]':
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:394:9:   required from here
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:178:15: error: no type named 'type' in 'struct std::enable_if<false, void>'
  178 |         using _Constructible = typename enable_if<
      |               ^~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:387:9: note: candidate: 'template<class _Yp, class> std::shared_ptr<_Tp>::shared_ptr(std::auto_ptr<_Up>&&) [with _Yp = _Tp1; _Tp = int]'
  387 |         shared_ptr(auto_ptr<_Yp>&& __r);
      |         ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:387:9: note:   template argument deduction/substitution failed:
p1777.cpp:468:42: note:   'std::remove_reference<std::unique_ptr<int []>&>::type' {aka 'std::unique_ptr<int []>'} is not derived from 'std::auto_ptr<_Up>'
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |                                          ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:380:18: note: candidate: 'template<class _Yp, class> std::shared_ptr<_Tp>::shared_ptr(const std::weak_ptr<_Yp>&) [with <template-parameter-2-2> = _Yp; _Tp = int]'
  380 |         explicit shared_ptr(const weak_ptr<_Yp>& __r)
      |                  ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:380:18: note:   template argument deduction/substitution failed:
p1777.cpp:468:42: note:   'std::remove_reference<std::unique_ptr<int []>&>::type' {aka 'std::unique_ptr<int []>'} is not derived from 'const std::weak_ptr<_Tp>'
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |                                          ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:368:9: note: candidate: 'template<class _Yp, class> std::shared_ptr<_Tp>::shared_ptr(std::shared_ptr<_Yp>&&) [with <template-parameter-2-2> = _Yp; _Tp = int]'
  368 |         shared_ptr(shared_ptr<_Yp>&& __r) noexcept
      |         ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:368:9: note:   template argument deduction/substitution failed:
p1777.cpp:468:42: note:   'std::remove_reference<std::unique_ptr<int []>&>::type' {aka 'std::unique_ptr<int []>'} is not derived from 'std::shared_ptr<_Tp>'
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |                                          ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:351:9: note: candidate: 'template<class _Yp, class> std::shared_ptr<_Tp>::shared_ptr(const std::shared_ptr<_Yp>&) [with <template-parameter-2-2> = _Yp; _Tp = int]'
  351 |         shared_ptr(const shared_ptr<_Yp>& __r) noexcept
      |         ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:351:9: note:   template argument deduction/substitution failed:
p1777.cpp:468:42: note:   'std::remove_reference<std::unique_ptr<int []>&>::type' {aka 'std::unique_ptr<int []>'} is not derived from 'const std::shared_ptr<_Tp>'
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |                                          ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:339:9: note: candidate: 'template<class _Yp> std::shared_ptr<_Tp>::shared_ptr(std::shared_ptr<_Yp>&&, element_type*) [with _Tp = int]'
  339 |         shared_ptr(shared_ptr<_Yp>&& __r, element_type* __p) noexcept
      |         ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:339:9: note:   template argument deduction/substitution failed:
p1777.cpp:468:42: note:   'std::remove_reference<std::unique_ptr<int []>&>::type' {aka 'std::unique_ptr<int []>'} is not derived from 'std::shared_ptr<_Tp>'
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |                                          ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:311:9: note: candidate: 'template<class _Yp> std::shared_ptr<_Tp>::shared_ptr(const std::shared_ptr<_Yp>&, element_type*) [with _Tp = int]'
  311 |         shared_ptr(const shared_ptr<_Yp>& __r, element_type* __p) noexcept
      |         ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:311:9: note:   template argument deduction/substitution failed:
p1777.cpp:468:42: note:   'std::remove_reference<std::unique_ptr<int []>&>::type' {aka 'std::unique_ptr<int []>'} is not derived from 'const std::shared_ptr<_Tp>'
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |                                          ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:287:9: note: candidate: 'template<class _Deleter, class _Alloc> std::shared_ptr<_Tp>::shared_ptr(std::nullptr_t, _Deleter, _Alloc) [with _Alloc = _Deleter; _Tp = int]'
  287 |         shared_ptr(nullptr_t __p, _Deleter __d, _Alloc __a)
      |         ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:287:9: note:   template argument deduction/substitution failed:
p1777.cpp:468:42: note:   candidate expects 3 arguments, 1 provided
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |                                          ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:268:9: note: candidate: 'template<class _Yp, class _Deleter, class _Alloc, class> std::shared_ptr<_Tp>::shared_ptr(_Yp*, _Deleter, _Alloc) [with _Deleter = _Yp; _Alloc = _Deleter; <template-parameter-2-4> = _Alloc; _Tp = int]'
  268 |         shared_ptr(_Yp* __p, _Deleter __d, _Alloc __a)
      |         ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:268:9: note:   template argument deduction/substitution failed:
p1777.cpp:468:42: note:   mismatched types '_Yp*' and 'std::unique_ptr<int []>'
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |                                          ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:248:9: note: candidate: 'template<class _Deleter> std::shared_ptr<_Tp>::shared_ptr(std::nullptr_t, _Deleter) [with _Tp = int]'
  248 |         shared_ptr(nullptr_t __p, _Deleter __d)
      |         ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:248:9: note:   template argument deduction/substitution failed:
p1777.cpp:468:42: note:   candidate expects 2 arguments, 1 provided
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |                                          ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:231:9: note: candidate: 'template<class _Yp, class _Deleter, class> std::shared_ptr<_Tp>::shared_ptr(_Yp*, _Deleter) [with _Deleter = _Yp; <template-parameter-2-3> = _Deleter; _Tp = int]'
  231 |         shared_ptr(_Yp* __p, _Deleter __d)
      |         ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:231:9: note:   template argument deduction/substitution failed:
p1777.cpp:468:42: note:   mismatched types '_Yp*' and 'std::unique_ptr<int []>'
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |                                          ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:214:9: note: candidate: 'template<class _Yp, class> std::shared_ptr<_Tp>::shared_ptr(_Yp*) [with <template-parameter-2-2> = _Yp; _Tp = int]'
  214 |         shared_ptr(_Yp* __p) : __shared_ptr<_Tp>(__p) { }
      |         ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:214:9: note:   template argument deduction/substitution failed:
p1777.cpp:468:42: note:   mismatched types '_Yp*' and 'std::unique_ptr<int []>'
  468 |   std::shared_ptr<int> ptr(std::move(arr));
      |                                          ^
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:535:7: note: candidate: 'std::shared_ptr<_Tp>::shared_ptr(const std::weak_ptr<_Tp>&, std::nothrow_t) [with _Tp = int'
  535 |       shared_ptr(const weak_ptr<_Tp>& __r, std::nothrow_t) noexcept
      |       ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:535:7: note:   candidate expects 2 arguments, 1 provided
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:412:17: note: candidate: 'constexpr std::shared_ptr<_Tp>::shared_ptr(std::nullptr_t) [with _Tp = int; std::nullptr_t = std::nullptr_t]'
  412 |       constexpr shared_ptr(nullptr_t) noexcept : shared_ptr() { }
      |                 ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:412:28: note:   no known conversion for argument 1 from 'std::remove_reference<std::unique_ptr<int []>&>::type' {aka 'std::unique_ptr<int []>'} to 'std::nullptr_t'
  412 |       constexpr shared_ptr(nullptr_t) noexcept : shared_ptr() { }
      |                            ^~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:359:7: note: candidate: 'std::shared_ptr<_Tp>::shared_ptr(std::shared_ptr<_Tp>&&) [with _Tp = int]'
  359 |       shared_ptr(shared_ptr&& __r) noexcept
      |       ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:359:31: note:   no known conversion for argument 1 from 'std::remove_reference<std::unique_ptr<int []>&>::type' {aka 'std::unique_ptr<int []>'} to 'std::shared_ptr<int>&&'
  359 |       shared_ptr(shared_ptr&& __r) noexcept
      |                  ~~~~~~~~~~~~~^~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:204:7: note: candidate: 'std::shared_ptr<_Tp>::shared_ptr(const std::shared_ptr<_Tp>&) [with _Tp = int]'
  204 |       shared_ptr(const shared_ptr&) noexcept = default; ///< Copy constructor
      |       ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:204:18: note:   no known conversion for argument 1 from 'std::remove_reference<std::unique_ptr<int []>&>::type' {aka 'std::unique_ptr<int []>'} to 'const std::shared_ptr<int>&'
  204 |       shared_ptr(const shared_ptr&) noexcept = default; ///< Copy constructor
      |                  ^~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:202:17: note: candidate: 'constexpr std::shared_ptr<_Tp>::shared_ptr() [with _Tp = int]'
  202 |       constexpr shared_ptr() noexcept : __shared_ptr<_Tp>() { }
      |                 ^~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/shared_ptr.h:202:17: note:   candidate expects 0 arguments, 1 provided
p1777.cpp:475:13: warning: declaration of 'int f(char*)' has 'extern' and is initialized
  475 | int f(char *) = delete;
      |             ^
p1777.cpp:478:10: error: use of deleted function 'int f(char*)'
  478 | int x = f(s.data()); // ill-formed; previously well-formed
      |         ~^~~~~~~~~~
p1777.cpp:475:5: note: declared here
  475 | int f(char *) = delete;
      |     ^
In file included from /usr/local/include/c++/12.1.0/cstddef:49,
                 from N4910.h:1:
/usr/local/include/c++/12.1.0/bits/stl_set.h:64:15: error: expected '=' before '__attribute__'
   64 | namespace std _GLIBCXX_VISIBILITY(default)
      |               ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_set.h:64:15: error: expected identifier before '__attribute__'
/usr/local/include/c++/12.1.0/bits/stl_set.h:64:15: error: expected ';' before '__attribute__'
In file included from /usr/local/include/c++/12.1.0/set:61,
                 from p1777.cpp:484:
/usr/local/include/c++/12.1.0/bits/stl_set.h:65:1: error: expected primary-expression before '{' token
   65 | {
      | ^
/usr/local/include/c++/12.1.0/bits/stl_multiset.h:64:15: error: expected '=' before '__attribute__'
   64 | namespace std _GLIBCXX_VISIBILITY(default)
      |               ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_multiset.h:64:15: error: expected identifier before '__attribute__'
/usr/local/include/c++/12.1.0/bits/stl_multiset.h:64:15: error: expected ';' before '__attribute__'
In file included from /usr/local/include/c++/12.1.0/set:62:
/usr/local/include/c++/12.1.0/bits/stl_multiset.h:65:1: error: expected primary-expression before '{' token
   65 | {
      | ^
/usr/local/include/c++/12.1.0/set:71:15: error: expected '=' before '__attribute__'
   71 | namespace std _GLIBCXX_VISIBILITY(default)
      |               ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/set:71:15: error: expected identifier before '__attribute__'
/usr/local/include/c++/12.1.0/set:71:15: error: expected ';' before '__attribute__'
/usr/local/include/c++/12.1.0/set:72:1: error: expected primary-expression before '{' token
   72 | {
      | ^
/usr/local/include/c++/12.1.0/set:87:15: error: expected '=' before '__attribute__'
   87 | namespace std _GLIBCXX_VISIBILITY(default)
      |               ^~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/set:87:15: error: expected identifier before '__attribute__'
/usr/local/include/c++/12.1.0/set:87:15: error: expected ';' before '__attribute__'
/usr/local/include/c++/12.1.0/set:88:1: error: expected primary-expression before '{' token
   88 | {
      | ^
p1777.cpp:491:11: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
  491 |   int main() {
      |           ^~
p1777.cpp:491:11: note: remove parentheses to default-initialize a variable
  491 |   int main() {
      |           ^~
      |           --
p1777.cpp:491:11: note: or replace parentheses with braces to value-initialize a variable
p1777.cpp:491:14: error: a function-definition is not allowed here before '{' token
  491 |   int main() {
      |              ^
p1777.cpp:511:5: error: conflicting declaration 'int x [2]'
  511 | int x[2] = { M(1'2,3'4, 5) };
      |     ^
p1777.cpp:478:5: note: previous declaration as 'int x'
  478 | int x = f(s.data()); // ill-formed; previously well-formed
      |     ^
p1777.cpp:531:23: error: a function-definition is not allowed here before '{' token
  531 |      int f(bool cond) {
      |                       ^
p1777.cpp:543:13: error: redefinition of 'struct D::bar(A*)::S'
  543 |      struct S {
      |             ^
p1777.cpp:527:13: note: previous definition of 'struct D::bar(A*)::S'
  527 |      struct S {
      |             ^
p1777.cpp:551:8: error: redefinition of 'struct D::bar(A*)::S'
  551 | struct S {
      |        ^
p1777.cpp:527:13: note: previous definition of 'struct D::bar(A*)::S'
  527 |      struct S {
      |             ^
p1777.cpp:581:13: error: conflicting declaration 'const char* s'
  581 | const char* s = u8"def"; // Previously "abcdef", now "def"
      |             ^
p1777.cpp:477:8: note: previous declaration as 'std::string s'
  477 | string s;
      |        ^
p1777.cpp:603:1: error: a template declaration cannot appear at block scope
  603 | template<int N> void g() {
      | ^~~~~~~~
p1777.cpp:615:10: error: redefinition of 'struct D::bar(A*)::S'
  615 |   struct S { operator int(); };
      |          ^
p1777.cpp:527:13: note: previous definition of 'struct D::bar(A*)::S'
  527 |      struct S {
      |             ^
cc1plus: error: 'operator int&&' is not a member of 'D::bar(A*)::S'
p1777.cpp:627:10: error: conflicting declaration 'int x []'
  627 |      int x[] = { 2.0 };
      |          ^
p1777.cpp:478:5: note: previous declaration as 'int x'
  478 | int x = f(s.data()); // ill-formed; previously well-formed
      |     ^
p1777.cpp:646:6: error: a template declaration cannot appear at block scope
  646 |      template <class T> struct X { };
      |      ^~~~~~~~
p1777.cpp:647:6: error: a template declaration cannot appear at block scope
  647 |      template <int N> struct Y { };
      |      ^~~~~~~~
p1777.cpp:648:6: error: 'D::bar(A*)::X' is not a template
  648 |      X< Y< 1 >> 2 > > x;
      |      ^
p1777.cpp:648:9: error: 'D::Y' is not a template
  648 |      X< Y< 1 >> 2 > > x;
      |         ^
p1777.cpp:648:17: error: expected unqualified-id before numeric constant
  648 |      X< Y< 1 >> 2 > > x;
      |                 ^
p1777.cpp:764:1: error: expected primary-expression before 'int'
  764 | int main2() {
      | ^~~
p1777.cpp:764:1: error: expected ')' before 'int'
p1777.cpp:717:1: note: to match this '('
  717 | (// 4.1) (4.2) (4.3) (4.4)
      | ^
p1777.cpp:799:7: error: declaration of 'char* p' shadows a parameter
  799 | char* p = "abc";
      |       ^
p1777.cpp:442:18: note: 'D::A* p' previously declared here
  442 |   void bar(A<0> *p) {
      |            ~~~~~~^
p1777.cpp:799:11: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  799 | char* p = "abc";
      |           ^~~~~
p1777.cpp:800:15: error: a function-definition is not allowed here before '{' token
  800 | void f(char*) {
      |               ^
p1777.cpp:811:12: error: redeclaration of 'int i'
  811 | int i; int i;
      |            ^
p1777.cpp:811:5: note: 'int i' previously declared here
  811 | int i; int i;
      |     ^
p1777.cpp:813:13: error: redefinition of 'struct D::bar(A*)::X'
  813 |      struct X { int i; struct X* next; };
      |             ^
p1777.cpp:554:8: note: previous definition of 'struct D::bar(A*)::X'
  554 | struct X {
      |        ^
p1777.cpp:814:22: error: redeclaration of 'D::bar(A*)::X a'
  814 |      static struct X a;
      |                      ^
p1777.cpp:558:3: note: 'D::bar(A*)::X a' previously declared here
  558 | X a{}; S b{a};
      |   ^
p1777.cpp:815:22: error: conflicting declaration 'D::bar(A*)::X b'
  815 |      static struct X b = { 0, &a };
      |                      ^
p1777.cpp:558:10: note: previous declaration as 'D::bar(A*)::S b'
  558 | X a{}; S b{a};
      |          ^
p1777.cpp:816:22: error: redeclaration of 'D::bar(A*)::X a'
  816 |      static struct X a = { 1, &b };
      |                      ^
p1777.cpp:558:3: note: 'D::bar(A*)::X a' previously declared here
  558 | X a{}; S b{a};
      |   ^
p1777.cpp:821:13: error: redefinition of 'struct D::bar(A*)::X'
  821 |      struct X {
      |             ^
p1777.cpp:554:8: note: previous definition of 'struct D::bar(A*)::X'
  554 | struct X {
      |        ^
p1777.cpp:824:10: error: no matching function for call to 'D::Y::Y()'
  824 | struct Y c;
      |          ^
p1777.cpp:198:3: note: candidate: 'constexpr D::Y::Y(const D::Y&)'
  198 |   Y(const Y&) = default;
      |   ^
p1777.cpp:198:3: note:   candidate expects 1 argument, 0 provided
p1777.cpp:850:11: error: conflicting declaration 'char a [10]'
  850 |      char a[10];
      |           ^
p1777.cpp:558:3: note: previous declaration as 'D::bar(A*)::X a'
  558 | X a{}; S b{a};
      |   ^
p1777.cpp:851:12: error: conflicting declaration 'void* b'
  851 |      void* b=a;
      |            ^
p1777.cpp:558:10: note: previous declaration as 'D::bar(A*)::S b'
  558 | X a{}; S b{a};
      |          ^
p1777.cpp:852:17: error: a function-definition is not allowed here before '{' token
  852 |      void foo() {
      |                 ^
p1777.cpp:857:12: error: conflicting declaration 'char* c'
  857 |      char* c = (char*) b;
      |            ^
p1777.cpp:824:10: note: previous declaration as 'D::Y c'
  824 | struct Y c;
      |          ^
p1777.cpp:857:16: error: invalid cast from type 'D::bar(A*)::S' to type 'char*'
  857 |      char* c = (char*) b;
      |                ^~~~~~~~~
p1777.cpp:872:27: error: types may not be defined in casts
  872 |      p = (void*)(struct x {int i;} *)0;
      |                           ^
p1777.cpp:872:10: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
  872 |      p = (void*)(struct x {int i;} *)0;
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |          |
      |          void*
p1777.cpp:881:11: error: conflicting declaration 'char arr [100]'
  881 |      char arr[100];
      |           ^~~
p1777.cpp:467:26: note: previous declaration as 'std::unique_ptr<int []> arr'
  467 |   std::unique_ptr<int[]> arr(new int[1]);
      |                          ^~~
p1777.cpp:902:1: error: expected ';' before 'static'
  902 | static struct S { // valid C, invalid in C++ int i;
      | ^~~~~~
p1777.cpp:882:6: warning: statement has no effect [-Wunused-value]
  882 |      sizeof(0, arr)
      |      ^~~~~~~~~~~~~~
p1777.cpp:919:12: error: using typedef-name 'name' after 'class'
  919 |      class name { /* ... */ };
      |            ^~~~
p1777.cpp:916:13: note: 'name' has a previous declaration here
  916 | typedef int name; // valid C, invalid C++
      |             ^~~~
p1777.cpp:920:6: error: redeclaration of 'name i'
  920 | name i; // i has type class name
      |      ^
p1777.cpp:811:5: note: 'int i' previously declared here
  811 | int i; int i;
      |     ^
p1777.cpp:930:14: error: 'parm' does not name a type
  930 | void f(const parm);
      |              ^~~~
p1777.cpp:931:7: error: 'n' does not name a type
  931 | const n = 3;
      |       ^
p1777.cpp:932:1: error: 'main3' was not declared in this scope; did you mean 'main'?
  932 | main3(){};
      | ^~~~~
      | main
p1777.cpp:936:10: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
  936 | int main4(){};
      |          ^~
p1777.cpp:936:10: note: remove parentheses to default-initialize a variable
  936 | int main4(){};
      |          ^~
      |          --
p1777.cpp:936:10: note: or replace parentheses with braces to value-initialize a variable
p1777.cpp:936:12: error: a function-definition is not allowed here before '{' token
  936 | int main4(){};
      |            ^
p1777.cpp:943:10: error: a function-definition is not allowed here before '{' token
  943 | void f() {
      |          ^
p1777.cpp:953:6: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
  953 | int f(); // means int f(void) in C++ // int f( unknown ) in C
      |      ^~
p1777.cpp:953:6: note: remove parentheses to default-initialize a variable
  953 | int f(); // means int f(void) in C++ // int f( unknown ) in C
      |      ^~
      |      --
p1777.cpp:953:6: note: or replace parentheses with braces to value-initialize a variable
p1777.cpp:962:16: error: redefinition of 'struct D::bar(A*)::S'
  962 | void f( struct S { int a; }
      |                ^
p1777.cpp:527:13: note: previous definition of 'struct D::bar(A*)::S'
  527 |      struct S {
      |             ^
p1777.cpp:964:6: error: types may not be defined in parameter types
  964 | enum E { A, B, C };
      |      ^
p1777.cpp:962:9: error: two or more data types in declaration of 'parameter'
  962 | void f( struct S { int a; }
      |         ^~~~~~
p1777.cpp:964:19: error: expected ')' before ';' token
  964 | enum E { A, B, C };
      |                   ^
p1777.cpp:962:7: note: to match this '('
  962 | void f( struct S { int a; }
      |       ^
p1777.cpp:965:2: error: call of overloaded 'f()' is ambiguous
  965 | f() {};
      | ~^~
p1777.cpp:962:6: note: candidate: 'void f(...)'
  962 | void f( struct S { int a; }
      |      ^
p1777.cpp:953:5: note: candidate: 'int f()'
  953 | int f(); // means int f(void) in C++ // int f( unknown ) in C
      |     ^
p1777.cpp:982:10: error: conflicting declaration 'D::bar(A*)::A a'
  982 | struct A a = {.y = 1, .x = 2}; //validC,invalidC++
      |          ^
p1777.cpp:558:3: note: previous declaration as 'D::bar(A*)::X a'
  558 | X a{}; S b{a};
      |   ^
p1777.cpp:983:5: error: conflicting declaration 'int arr [3]'
  983 | int arr[3] = {[1] = 5};
      |     ^~~
p1777.cpp:467:26: note: previous declaration as 'std::unique_ptr<int []> arr'
  467 |   std::unique_ptr<int[]> arr(new int[1]);
      |                          ^~~
p1777.cpp:984:10: error: conflicting declaration 'D::bar(A*)::B b'
  984 | struct B b = {.a.x = 0};
      |          ^
p1777.cpp:558:10: note: previous declaration as 'D::bar(A*)::S b'
  558 | X a{}; S b{a};
      |          ^
p1777.cpp:984:15: error: expected primary-expression before '.' token
  984 | struct B b = {.a.x = 0};
      |               ^
p1777.cpp:985:10: error: conflicting declaration 'D::bar(A*)::A c'
  985 | struct A c = {.x = 1, 2};
      |          ^
p1777.cpp:824:10: note: previous declaration as 'D::Y c'
  824 | struct Y c;
      |          ^
p1777.cpp:985:23: error: either all initializer clauses should be designated or none of them should be
  985 | struct A c = {.x = 1, 2};
      |                       ^
p1777.cpp:994:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
  994 | char array[4] = "abcd"; // valid C, invalid C++
      |                 ^~~~~~
p1777.cpp:1003:12: error: conflicting declaration 'D::bar(A*)::color c'
 1003 | enum color c = 1; // valid C, invalid C++
      |            ^
p1777.cpp:824:10: note: previous declaration as 'D::Y c'
  824 | struct Y c;
      |          ^
p1777.cpp:1013:1: error: expected ';' before 'sizeof'
 1013 | sizeof(A) == sizeof(e) // in C++
      | ^~~~~~
p1777.cpp:1012:11: warning: statement has no effect [-Wunused-value]
 1012 | sizeof(A) == sizeof(int) // in C
      | ~~~~~~~~~~^~~~~~~~~~~~~~
p1777.cpp:1024:15: error: a function-definition is not allowed here before '{' token
 1024 |      void f() {
      |               ^
p1777.cpp:1034:8: error: redefinition of 'struct D::bar(A*)::X'
 1034 | struct X { int i; };
      |        ^
p1777.cpp:554:8: note: previous definition of 'struct D::bar(A*)::X'
  554 | struct X {
      |        ^
p1777.cpp:1035:26: error: too many initializers for 'volatile D::bar(A*)::X'
 1035 | volatile struct X x1 = {0};
      |                          ^
p1777.cpp:1036:15: error: no matching function for call to 'X(volatile D::bar(A*)::X&)'
 1036 | struct X x2 = x1; // invalid C++ struct X x3;
      |               ^~
p1777.cpp:554:8: note: candidate: 'constexpr D::bar(A*)::X::X(const D::bar(A*)::X&)' (near match)
  554 | struct X {
      |        ^
p1777.cpp:554:8: note:   conversion of argument 1 would be ill-formed:
p1777.cpp:1036:15: error: binding reference of type 'const D::bar(A*)::X&' to 'volatile D::bar(A*)::X' discards qualifiers
 1036 | struct X x2 = x1; // invalid C++ struct X x3;
      |               ^~
p1777.cpp:554:8: note: candidate: 'constexpr D::bar(A*)::X::X(D::bar(A*)::X&&)' (near match)
  554 | struct X {
      |        ^
p1777.cpp:554:8: note:   conversion of argument 1 would be ill-formed:
p1777.cpp:1036:15: error: cannot bind rvalue reference of type 'D::bar(A*)::X&&' to lvalue of type 'volatile D::bar(A*)::X'
 1036 | struct X x2 = x1; // invalid C++ struct X x3;
      |               ^~
p1777.cpp:1037:1: error: 'x3' was not declared in this scope; did you mean 'x1'?
 1037 | x3=x1; // also invalid C++
      | ^~
      | x1
p1777.cpp:1051:13: error: redefinition of 'struct D::bar(A*)::X'
 1051 |      struct X {
      |             ^
p1777.cpp:554:8: note: previous definition of 'struct D::bar(A*)::X'
  554 | struct X {
      |        ^
p1777.cpp:1054:10: error: no matching function for call to 'D::Y::Y()'
 1054 | struct Y yy; // valid C, invalid C++
      |          ^~
p1777.cpp:198:3: note: candidate: 'constexpr D::Y::Y(const D::Y&)'
  198 |   Y(const Y&) = default;
      |   ^
p1777.cpp:198:3: note:   candidate expects 1 argument, 0 provided
p1777.cpp:1059:8: error: redefinition of 'struct D::bar(A*)::X'
 1059 | struct X {
      |        ^
p1777.cpp:554:8: note: previous definition of 'struct D::bar(A*)::X'
  554 | struct X {
      |        ^
p1777.cpp:1068:10: error: redefinition of 'struct D::bar(A*)::S'
 1068 |   struct S {
      |          ^
p1777.cpp:527:13: note: previous definition of 'struct D::bar(A*)::S'
  527 |      struct S {
      |             ^
p1777.cpp:1126:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
 1126 | int main() {
      |         ^~
p1777.cpp:1126:9: note: remove parentheses to default-initialize a variable
 1126 | int main() {
      |         ^~
      |         --
p1777.cpp:1126:9: note: or replace parentheses with braces to value-initialize a variable
p1777.cpp:1126:12: error: a function-definition is not allowed here before '{' token
 1126 | int main() {
      |            ^
p1777.cpp:1132:2: error: expected '}' at end of input
 1132 | }
      |  ^
p1777.cpp:442:21: note: to match this '{'
  442 |   void bar(A<0> *p) {
      |                     ^
p1777.cpp:478:5: warning: unused variable 'x' [-Wunused-variable]
  478 | int x = f(s.data()); // ill-formed; previously well-formed
      |     ^
p1777.cpp:616:8: warning: unused variable 'b2' [-Wunused-variable]
  616 |   bool b2 = &S::operator int && false;
      |        ^~
p1777.cpp:811:5: warning: unused variable 'i' [-Wunused-variable]
  811 | int i; int i;
      |     ^
p1777.cpp:824:10: warning: unused variable 'c' [-Wunused-variable]
  824 | struct Y c;
      |          ^
p1777.cpp:935:11: warning: unused variable 'n' [-Wunused-variable]
  935 | const int n = 3;
      |           ^
p1777.cpp:994:6: warning: unused variable 'array' [-Wunused-variable]
  994 | char array[4] = "abcd"; // valid C, invalid C++
      |      ^~~~~
p1777.cpp:1036:10: warning: unused variable 'x2' [-Wunused-variable]
 1036 | struct X x2 = x1; // invalid C++ struct X x3;
      |          ^~
p1777.cpp:1054:10: warning: unused variable 'yy' [-Wunused-variable]
 1054 | struct Y yy; // valid C, invalid C++
      |          ^~
p1777.cpp: At global scope:
p1777.cpp:1132:2: error: expected unqualified-id at end of input
 1132 | }
      |  ^

検討事項(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 箱庭 

箱庭もくもく会

第11回 未定

箱庭ではUnityをはじめC++を使っているらしい。 

ここでコンパイルしたコードと同じようなコードを使っているか、
ここで出たコンパイルエラーと同じようなエラーがでたかを
いろいろな版のコンパイラでコンパイルして確認していく。

この項目は、箱庭プロジェクトを市場分析の対象として、原則的には、箱庭プロジェクトの外部から分析し、外部から箱庭の広告宣伝のための戦略会議を仮想した結果、仮想「箱庭もくもく会」を開催してみることを企画するものである。 
一切の内容は、箱庭プロジェクト、Athrill, TOPPERSとは無関係である。 
一(いち)参加データアナリストの、個人的なつぶやきです。

仮想戦略会議「箱庭」

お盆には「箱庭」記事を書きましょう「もくもく会」の題材になる(1)

お盆には「箱庭」記事を書きましょう「もくもく会」の題材になる(2)

自己参考資料(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 初稿  20221010

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0