Skip to content

Commit 9aacb5c

Browse files
committed
[ub,ifndr] Fix column alignment of comments
1 parent fecc841 commit 9aacb5c

File tree

2 files changed

+170
-197
lines changed

2 files changed

+170
-197
lines changed

source/ifndr.tex

+42-44
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
\pnum
2020
\begin{example}
2121
\begin{codeblock}
22-
int _z; // No diagnostic required, \_z is reserved because it starts with \_ at global scope
22+
int _z; // no diagnostic required, \tcode{\_z} is reserved because it starts with \tcode{\_} at global scope
2323

2424
int main() {
25-
int __x; // No diagnostic required, \_\_x is reserved because it starts with \_\_
26-
int _Y; // No diagnostic required, \_Y is reserved because it starts with \_ followed by a capital letter
27-
int x__y; // No diagnostic required, x\_\_y is reserved because it contains \_\_
25+
int __x; // no diagnostic required, \tcode{\_\_x} is reserved because it starts with \tcode{\_\_}
26+
int _Y; // no diagnostic required, \tcode{\_Y} is reserved because it starts with \tcode{\_} followed by a capital letter
27+
int x__y; // no diagnostic required, \tcode{x\_\_y} is reserved because it contains \tcode{\_\_}
2828
}
2929
\end{codeblock}
3030
\end{example}
@@ -47,9 +47,9 @@
4747
return A{};
4848
}
4949
decltype(f()) g();
50-
auto x = g(); // Ill-formed, no diagnostic required, function g is used but not defined
51-
// in this translation unit, and cannot be defined in any other translation unit
52-
// because its type does not have linkage
50+
auto x = g(); // ill-formed, no diagnostic required, function \tcode{g} is used but not defined
51+
// in this translation unit, and cannot be defined in any other translation unit
52+
// because its type does not have linkage
5353
\end{codeblock}
5454
\end{example}
5555

@@ -73,8 +73,8 @@
7373
// main.cpp
7474
import "a.h";
7575
import "b.h";
76-
auto n = decltype(a)::b; // Ill-formed no diagnostic required, more than one unnammed enum
77-
// definition reachable at this point but their types are not the same
76+
auto n = decltype(a)::b; // ill-formed no diagnostic required, more than one unnammed enum
77+
// definition reachable at this point but their types are not the same
7878
\end{codeblock}
7979
\end{example}
8080

@@ -166,9 +166,9 @@
166166
int main() {
167167
using T = const int;
168168
T(x)
169-
(100), (y)(A<x>::a); // Ill-formed no diagnostic required, during trial parse the template
170-
// parameter x is bound to the global x later during parsing the template
171-
// parameter x is bound to the local x declared on the same line
169+
(100), (y)(A<x>::a); // ill-formed no diagnostic required, during trial parse the template
170+
// parameter \tcode{x} is bound to the global \tcode{x} later during parsing the template
171+
// parameter \tcode{x} is bound to the local \tcode{x} declared on the same line
172172
}
173173
\end{codeblock}
174174
\end{example}
@@ -190,7 +190,7 @@
190190
struct S { int x; } s, *p = &s;
191191

192192
// Translation unit \#2:
193-
struct alignas(16) S; // ill-formed, no diagnostic required: definition of S lacks alignment
193+
struct alignas(16) S; // ill-formed, no diagnostic required, definition of \tcode{S} lacks alignment
194194
extern S* p;
195195
\end{codeblock}
196196
\end{example}
@@ -208,7 +208,7 @@
208208
}
209209

210210
/* Translation Unit B */
211-
struct void f(int i); // Ill-formed no diagnostic required, declared without noreturn
211+
struct void f(int i); // ill-formed no diagnostic required, declared without noreturn
212212
\end{codeblock}
213213
\end{example}
214214

@@ -225,11 +225,11 @@
225225
\pnum
226226
\begin{example}
227227
\begin{codeblock}
228-
module std; // Ill-formed no diagnostic required, std is not allowed at the beginning
229-
module module; // Ill-formed no diagnostic required, module is a reserved identifier
230-
module std0; // Ill-formed no diagnostic required, std followed by digits is not allowed at the beginning
231-
export module _Test; // Ill-formed no diagnostic required, _Test is a reserved identifier
232-
export module te__st; // Ill-formed no diagnostic required, te__st is a reserved identifier
228+
module std; // ill-formed no diagnostic required, \tcode{std} is not allowed at the beginning
229+
module module; // ill-formed no diagnostic required, \tcode{module} is a reserved identifier
230+
module std0; // ill-formed no diagnostic required, \tcode{std} followed by digits is not allowed at the beginning
231+
export module _Test; // ill-formed no diagnostic required, \tcode{_Test} is a reserved identifier
232+
export module te__st; // ill-formed no diagnostic required, \tcode{te__st} is a reserved identifier
233233
\end{codeblock}
234234
\end{example}
235235

@@ -244,7 +244,7 @@
244244
\begin{example}
245245
\begin{codeblock}
246246
module A;
247-
export import :Internals; // Ill-formed no diagnostic required, module parition not allowed
247+
export import :Internals; // ill-formed no diagnostic required, module partition not allowed
248248
\end{codeblock}
249249
\end{example}
250250

@@ -262,10 +262,10 @@
262262
\begin{example}
263263
\begin{codeblock}
264264
struct C {
265-
C( int ) { } // \#1: non-delegating constructor
266-
C(): C(42) { } // \#2: delegates to \#1
267-
C( char c ) : C(42.0) { } // \#3: ill-formed no diagnostic required due to recursion with \#4
268-
C( double d ) : C('a') { } // \#4: ill-formed no diagnostic required due to recursion with \#3
265+
C( int ) { } // \#1: non-delegating constructor
266+
C(): C(42) { } // \#2: delegates to \#1
267+
C( char c ) : C(42.0) { } // \#3: ill-formed no diagnostic required due to recursion with \#4
268+
C( double d ) : C('a') { } // \#4: ill-formed no diagnostic required due to recursion with \#3
269269
};
270270
\end{codeblock}
271271
\end{example}
@@ -286,7 +286,7 @@
286286
};
287287

288288
int main() {
289-
A a; // Ill-formed no diagnostic required, virtual function that is not pure but has not definition
289+
A a; // ill-formed no diagnostic required, virtual function that is not pure but has not definition
290290
}
291291
\end{codeblock}
292292
\end{example}
@@ -305,10 +305,8 @@
305305
\pnum
306306
\begin{example}
307307
\begin{codeblock}
308-
float operator ""E(const char*); // ill-formed, no diagnostic required:
309-
// reserved literal suffix
310-
double operator"" _Bq(long double); // ill-formed, no diagnostic required:
311-
// uses the reserved identifier _Bq
308+
float operator ""E(const char*); // ill-formed, no diagnostic required, reserved literal suffix
309+
double operator"" _Bq(long double); // ill-formed, no diagnostic required, // uses the reserved identifier \tcode{_Bq}
312310
\end{codeblock}
313311
\end{example}
314312

@@ -333,8 +331,8 @@
333331
// a.cpp
334332
#include "a.h"
335333
int main() {
336-
f<int>(); // Ill-formed no diagnostic required, function template implicity
337-
// instantiated but not reachable definition
334+
f<int>(); // ill-formed no diagnostic required, function template implicity
335+
// instantiated but not reachable definition
338336
}
339337
\end{codeblock}
340338
\end{example}
@@ -388,9 +386,9 @@
388386
template <unsigned N> int f2()
389387
requires Add1<N * 2> && true;
390388
void h2() {
391-
f2<0>(); // ill-formed, no diagnostic required:
392-
// requires determination of subsumption between atomic constraints that are
393-
// functionally equivalent but not equivalent
389+
f2<0>(); // ill-formed, no diagnostic required,
390+
// requires determination of subsumption between atomic constraints that are
391+
// functionally equivalent but not equivalent
394392
\end{codeblock}
395393
\end{example}
396394

@@ -405,10 +403,10 @@
405403
concept Complete = sizeof(T) == sizeof(T);
406404

407405
struct A;
408-
static_assert(!Complete<A>); // 1
406+
static_assert(!Complete<A>); // \#1
409407
struct A {};
410-
static_assert(Complete<A>); // Ill-formed no diagnostic required, satisfaction
411-
// result differs from point 1
408+
static_assert(Complete<A>); // ill-formed no diagnostic required, satisfaction
409+
// result differs from point \#1
412410
\end{codeblock}
413411
\end{example}
414412

@@ -446,8 +444,8 @@
446444
void foo(){};
447445
};
448446

449-
template class X<void *>; // Ill-formed no diagnostic required, explicit instantiation
450-
// and partial specialization is not reachable
447+
template class X<void *>; // ill-formed no diagnostic required, explicit instantiation
448+
// and partial specialization is not reachable
451449

452450
template<typename T> class X<T*>{
453451
public:
@@ -474,7 +472,7 @@
474472
Ptr<int> p; // error: constraints not satisfied
475473

476474
template<typename T>
477-
struct S2 { Ptr<int> x; }; // ill-formed, no diagnostic required
475+
struct S2 { Ptr<int> x; }; // ill-formed, no diagnostic required
478476
\end{codeblock}
479477
\end{example}
480478

@@ -569,8 +567,8 @@
569567
extern template class std::vector<int>;
570568

571569
int main() {
572-
std::cout << std::vector<int>().size(); // Ill-formed no diagnostic required, implicit instantiation
573-
// but no explicit instantiation definition
570+
std::cout << std::vector<int>().size(); // ill-formed no diagnostic required, implicit instantiation
571+
// but no explicit instantiation definition
574572
}
575573
\end{codeblock}
576574
\end{example}
@@ -590,11 +588,11 @@
590588
\begin{example}
591589
\begin{codeblock}
592590
template <class T> typename T::X h(typename A<T>::X);
593-
template <class T> auto h(typename A<T>::X) -> typename T::X; // redeclaration
591+
template <class T> auto h(typename A<T>::X) -> typename T::X; // redeclaration
594592
template <class T> void h(...) { }
595593

596594
void x() {
597-
h<int>(0); // ill-formed, no diagnostic required
595+
h<int>(0); // ill-formed, no diagnostic required
598596
}
599597
\end{codeblock}
600598
\end{example}

0 commit comments

Comments
 (0)