Annex G (informative) Ill-formed, no diagnostic required [ifndr]

G.6 [dcl]: Declarations [ifndr.dcl]

G.6.1[ifndr:dcl.constinit.specifier.not.reachable]
Specified in: [dcl.constinit]

If the initializing declaration of a variable without the constinit specifier has the constinit specifier applied to declarations that are not reachable from that initializing declaration, the program is ill-formed, no diagnostic required.
[Example 1: 

Translation unit #1:int x = 5; // initializing declaration of x

Translation unit #2:extern constinit int x; // IFNDR, not reachable from initializing declaration of x — end example]

G.6.2[ifndr:dcl.inline.missing.on.definition]
Specified in: [dcl.inline]

If a function or variable with external or module linkage is declared inline but there is no inline declaration reachable from the end of some definition domain the program is ill-formed, no diagnostic required.
[Example 1: 

Translation unit #1:inline int f();

Translation unit #2:int f() { return 17; } // IFNDR, end of definition domain but no inline declaration of f is reachable — end example]

G.6.3[ifndr:dcl.fct.default.inline.same.defaults]
Specified in: [dcl.fct.default]

If the accumulated set of default arguments for a given inline function with definitions in multiple translation units is different at the end of different translation units, the program is ill-formed, no diagnostic required.
[Example 1: 

Translation unit #1:inline int f(int x, int y = 2); inline int f(int x = 1, int y); // IFNDR, default arguments of f are 1 and 2

Translation unit #2:inline int f(int x = 3, int y = 4); // IFNDR, default arguments of f are 3 and 4 — end example]

G.6.4[ifndr:dcl.contract.func.mismatched.contract.specifiers]
Specified in: [dcl.contract.func]

If two different first declarations of a function (which must therefore not be reachable from one another) do not have equivalent function contract specifiers the program is ill-formed, no diagnostic required.
[Example 1: 

Translation unit #1:int f(int x) pre(x >= 0); // IFNDR, pre present, not present in the other first declaration of f int g(int x) pre(x == 0); // IFNDR, pre differs from the other first declaration of g int h(int x) pre(x <= 0); // OK, pre equivalent to pre on the other first declaration of h

Translation unit #2:int f(int x); // IFNDR, pre not present, present in the other first declaration of f int g(int x) pre(x != 0); // IFNDR, pre differs from the other first declaration of g int h(int y) pre(y <= 0); // OK, pre equivalent to pre on the other first declaration of h — end example]

G.6.5[ifndr:dcl.fct.def.replace.bad.replacement]
Specified in: [dcl.fct.def.replace]

A declaration of a replaceable function that is inline, not attached to the global module, does not have C++ language linkage, does not have the required return type, or is not a valid redeclaration of the corresponding declaration in a standard library header (if there is one) then the program is ill-formed, no diagnostic required.
[Example 1: extern "C" // IFNDR, wrong language linkage inline // IFNDR, inline int // IFNDR, wrong return type handle_contract_violation(const std::contracts::contract_violation&) {} void* operator new(decltype(sizeof(0))) noexcept; // IFNDR, mismatched exception specification to // declaration in <new> — end example]

G.6.6[ifndr:dcl.link.mismatched.language.linkage]
Specified in: [dcl.link]

If two declarations of an entity do not have the same language linkage and neither is reachable from the other the program is ill-formed, no diagnostic required.
[Example 1: 

Translation unit #1:extern "C" { void f(); }

Translation unit #2:extern "C++" { void f(); } // IFNDR, different language linkage — end example]

G.6.7[ifndr:dcl.align.diff.translation.units]
Specified in: [dcl.align]

No diagnostic is required if declarations of an entity have different alignment-specifiers in different translation units.
[Example 1: 

Translation unit #1:struct S { int x; } s, *p = &s;

Translation unit #2:struct alignas(16) S; // IFNDR, definition of S lacks alignment extern S* p; — end example]

G.6.8[ifndr:dcl.attr.indet.mismatched.declarations]
Specified in: [dcl.attr.indet]

If two first declarations of a function declare a function parameter with mismatched uses of the indeterminate attribute, the program is ill-formed, no diagnostic required.
[Example 1: 

Translation unit #1:int h(int x [[indeterminate]]); // IFNDR, mismatched [[indeterminate]] to other first declaration of h

Translation unit #2:int h(int x); // IFNDR, mismatched [[indeterminate]] to other first declaration of h — end example]

G.6.9[ifndr:dcl.attr.noreturn.trans.unit.mismatch]
Specified in: [dcl.attr.noreturn]

No diagnostic is required if a function is declared in one translation unit with the noreturn attribute but has declarations in other translation units without the attribute.
[Example 1: 

Translation unit #1:[[noreturn]] void f() {}

Translation unit #2:void f(); // IFNDR, declared without noreturn — end example]