Skip to content

Commit

Permalink
Remove inappropriate paragraph breaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eelis committed May 15, 2017
1 parent 8a966fa commit 5d6ff07
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 115 deletions.
52 changes: 0 additions & 52 deletions source/basic.tex
Expand Up @@ -214,7 +214,6 @@
\deflinkx{move assignment operator}{assignment operator!move}{\ref{class.copy}},
or \link{destructor}{\ref{class.dtor}} member functions. \end{note}
\begin{example} Given

\begin{codeblock}
#include <string>

Expand All @@ -228,10 +227,8 @@
b = a;
}
\end{codeblock}

the implementation will implicitly define functions to make the
definition of \tcode{C} equivalent to

\begin{codeblock}
struct C {
std::string s;
Expand Down Expand Up @@ -377,7 +374,6 @@
the class is used in a way that requires the class type to be complete.
\begin{example} The following complete translation unit is well-formed,
even though it never defines \tcode{X}:

\begin{codeblock}
struct X; // declare \tcode{X} as a struct type
struct X* x1; // use \tcode{X} in pointer formation
Expand Down Expand Up @@ -483,7 +479,6 @@
implicit definition in every translation unit shall call the same
constructor for a subobject of \tcode{D}.
\begin{example}

\begin{codeblock}
// translation unit 1:
struct X {
Expand Down Expand Up @@ -548,15 +543,13 @@
\pnum
\begin{example}
In

\begin{codeblock}
int j = 24;
int main() {
int i = j, j;
j = 42;
}
\end{codeblock}

the identifier \tcode{j} is declared twice as a name (and used twice).
The declarative region of the first \tcode{j} includes the entire
example. The potential scope of the first \tcode{j} begins immediately
Expand Down Expand Up @@ -614,12 +607,10 @@
The \defn{point of declaration} for a name is immediately after its
complete \link{declarator}{Clause~\ref{dcl.decl}} and before its
\grammarterm{initializer} (if any), except as noted below. \begin{example}

\begin{codeblock}
unsigned char x = 12;
{ unsigned char x = x; }
\end{codeblock}

Here the second \tcode{x} is initialized with its own (indeterminate)
value. \end{example}

Expand All @@ -628,12 +619,10 @@
\indextext{name hiding}%
A name from an outer scope remains visible up
to the point of declaration of the name that hides it. \begin{example}

\begin{codeblock}
const int i = 2;
{ int i[i]; }
\end{codeblock}

declares a block-scope array of two integers. \end{example} \end{note}

\pnum
Expand All @@ -656,12 +645,10 @@
\indextext{declaration!enumerator point of}%
The point of declaration for an enumerator is immediately after its
\grammarterm{enumerator-definition}. \begin{example}

\begin{codeblock}
const int x = 12;
{ enum { x = x }; }
\end{codeblock}

Here, the enumerator \tcode{x} is initialized with the value of the
constant \tcode{x}, namely 12. \end{example}

Expand All @@ -670,7 +657,6 @@
looked up in the scope of its class. \begin{note}
\indextext{type!incomplete}%
This is true even if the class is an incomplete class. For example,

\begin{codeblock}
struct X {
enum E { z = 16 };
Expand All @@ -684,20 +670,16 @@
\grammarterm{elaborated-type-specifier} is as follows:
\begin{itemize}
\item for a declaration of the form

\begin{ncbnf}
class-key \opt{attribute-specifier-seq} identifier \terminal{;}
\end{ncbnf}

the \grammarterm{identifier} is declared to be a
\grammarterm{class-name} in the scope that contains the declaration,
otherwise
\item for an \grammarterm{elaborated-type-specifier} of the form

\begin{ncbnf}
class-key identifier
\end{ncbnf}

if the
\grammarterm{elaborated-type-specifier} is used in the
\grammarterm{decl-specifier-seq} or \grammarterm{parameter-declaration-clause}
Expand Down Expand Up @@ -725,7 +707,6 @@
\pnum
The point of declaration for a template parameter is immediately after its complete
\grammarterm{template-parameter}. \begin{example}

\begin{codeblock}
typedef unsigned char T;
template<class T
Expand Down Expand Up @@ -829,7 +810,6 @@
member's namespace, the member's potential scope includes that portion
of the potential scope of the \grammarterm{using-directive} that follows
the member's point of declaration. \begin{example}

\begin{codeblock}
namespace N {
int i;
Expand Down Expand Up @@ -974,7 +954,6 @@
the \grammarterm{declaration} of a \grammarterm{template-declaration} is instead
introduced into the same declarative region where it would be introduced as a result of
a non-template declaration of the same name. \begin{example}

\begin{codeblock}
namespace N {
template<class T> struct A { }; // \#1
Expand All @@ -984,7 +963,6 @@
};
}
\end{codeblock}

The declarative regions of \tcode{T}, \tcode{U} and \tcode{V} are the
\grammarterm{template-declaration}{s} on lines \#1, \#2, and \#3,
respectively. But the names \tcode{A}, \tcode{f}, \tcode{g} and \tcode{C} all belong to
Expand All @@ -1000,20 +978,16 @@
declaration of subsequent \grammarterm{template-parameter}{s} and their default
arguments but cannot be used in preceding \grammarterm{template-parameter}{s} or their
default arguments. For example,

\begin{codeblock}
template<class T, T* p, class U = T> class X { @\commentellip@ };
template<class T> void f(T* p = new T);
\end{codeblock}

This also implies that a \grammarterm{template-parameter} can be used in the
specification of base classes. For example,

\begin{codeblock}
template<class T> class X : public Array<T> { @\commentellip@ };
template<class T> class Y : public T { @\commentellip@ };
\end{codeblock}

The use of a template parameter as a base class implies that a class used as a template
argument must be defined and not just declared when the class template is instantiated.
\end{note}
Expand All @@ -1023,12 +997,10 @@
immediately-enclosing declarative region. \begin{note} As a result, a
\grammarterm{template-parameter} \link{hides}{\ref{basic.scope.hiding}} any entity with the same name in an enclosing
scope. \begin{example}

\begin{codeblock}
typedef int N;
template<N X, typename N, template<N Y> class T> struct A;
\end{codeblock}

Here, \tcode{X} is a non-type template parameter of type \tcode{int} and \tcode{Y} is a
non-type template parameter of the same type as the second template parameter of
\tcode{A}. \end{example}\end{note}
Expand Down Expand Up @@ -1142,7 +1114,6 @@
\grammarterm{postfix-expression} for a function call, the usual name lookup
rules apply. The rules in~\ref{basic.lookup.argdep} have no effect on
the syntactic interpretation of an expression. For example,

\begin{codeblock}
typedef int f;
namespace N {
Expand All @@ -1155,7 +1126,6 @@
};
}
\end{codeblock}

Because the expression is not a function call, the \link{argument-dependent
name lookup}{\ref{basic.lookup.argdep}} does not apply and the friend
function \tcode{f} is not found. \end{note}
Expand Down Expand Up @@ -1183,7 +1153,6 @@
use in namespace \tcode{N} or, if \tcode{N} is a nested namespace, shall
be declared before its use in one of \tcode{N}'s enclosing namespaces.
\begin{example}

\begin{codeblock}
namespace A {
namespace N {
Expand Down Expand Up @@ -1655,14 +1624,11 @@
up as types in the scope designated by the
\grammarterm{nested-name-specifier}. Similarly, in a
\grammarterm{qualified-id} of the form:

\begin{ncbnf}
\opt{nested-name-specifier} class-name \terminal{::} \terminal{\tilde} class-name
\end{ncbnf}

the second \grammarterm{class-name} is looked up in the same scope as the
first. \begin{example}

\begin{codeblock}
struct C {
typedef int I;
Expand Down Expand Up @@ -1896,7 +1862,6 @@
\begin{example}
Because each referenced namespace is searched at most once, the
following is well-defined:

\begin{codeblock}
namespace B {
int b;
Expand Down Expand Up @@ -1930,7 +1895,6 @@
only if the declarations are from the same namespace; otherwise (the
declarations are from different namespaces), the program is ill-formed.
\begin{example}

\begin{codeblock}
namespace A {
struct x { };
Expand All @@ -1955,17 +1919,14 @@
In a declaration for a namespace member in which the
\grammarterm{declarator-id} is a \grammarterm{qualified-id}, given that the
\grammarterm{qualified-id} for the namespace member has the form

\begin{ncbnf}
nested-name-specifier unqualified-id
\end{ncbnf}

the
\grammarterm{unqualified-id} shall name a member of the namespace
designated by the \grammarterm{nested-name-specifier}
or of an element of the \deflink{inline namespace set}{\ref{namespace.def}} of that namespace.
\begin{example}

\begin{codeblock}
namespace A {
namespace B {
Expand All @@ -1975,12 +1936,10 @@
}
void A::f1(int){ } // ill-formed, \tcode{f1} is not a member of \tcode{A}
\end{codeblock}

\end{example} However, in such namespace member declarations, the
\grammarterm{nested-name-specifier} may rely on \grammarterm{using-directive}{s}
to implicitly provide the initial part of the
\grammarterm{nested-name-specifier}. \begin{example}

\begin{codeblock}
namespace A {
namespace B {
Expand Down Expand Up @@ -2017,11 +1976,9 @@
\grammarterm{nested-name-specifier}, and unless the
\grammarterm{elaborated-type-specifier} appears in a declaration with the
following form:

\begin{ncbnf}
class-key \opt{attribute-specifier-seq} identifier \terminal{;}
\end{ncbnf}

the \grammarterm{identifier} is looked up according
to~\ref{basic.lookup.unqual} but ignoring any non-type names that have
been declared. If the \grammarterm{elaborated-type-specifier} is introduced
Expand All @@ -2032,11 +1989,9 @@
declared \grammarterm{type-name}, or if the
\grammarterm{elaborated-type-specifier} appears in a declaration with the
form:

\begin{ncbnf}
class-key \opt{attribute-specifier-seq} identifier \terminal{;}
\end{ncbnf}

the \grammarterm{elaborated-type-specifier} is a declaration that
introduces the \grammarterm{class-name} as described
in~\ref{basic.scope.pdecl}.
Expand All @@ -2048,7 +2003,6 @@
that have been declared. If the name lookup does not find a previously
declared \grammarterm{type-name}, the \grammarterm{elaborated-type-specifier}
is ill-formed. \begin{example}

\begin{codeblock}
struct Node {
struct Node* Next; // OK: Refers to \tcode{Node} at global scope
Expand Down Expand Up @@ -2110,7 +2064,6 @@
expression is of a class type \tcode{C}, the \grammarterm{type-name} is
also looked up in the scope of class \tcode{C}. At least one of the
lookups shall find a name that refers to \cv{}~\tcode{T}. \begin{example}

\begin{codeblock}
struct A { };

Expand Down Expand Up @@ -2298,7 +2251,6 @@
}
}
\end{codeblock}

Without the declaration at line \#2,
the declaration at line \#3 would link with the declaration at line \#1.
Because the declaration with internal linkage is hidden, however,
Expand All @@ -2310,7 +2262,6 @@
refer to some other declaration, then that entity is a member of the
innermost enclosing namespace. However such a declaration does not
introduce the member name in its namespace scope. \begin{example}

\begin{codeblock}
namespace X {
void p() {
Expand Down Expand Up @@ -3456,7 +3407,6 @@
that same storage location when the implicit destructor call takes
place; otherwise the behavior of the program is undefined. This is true
even if the block is exited with an exception. \begin{example}

\begin{codeblock}
class T { };
struct B {
Expand Down Expand Up @@ -3545,7 +3495,6 @@
the library functions~(\ref{headers}) \tcode{std::memcpy} or \tcode{std::memmove}.}
\tcode{obj2} shall subsequently hold the same value as
\tcode{obj1}. \begin{example}

\begin{codeblock}
T* t1p;
T* t2p;
Expand Down Expand Up @@ -3601,7 +3550,6 @@
\tcode{N} \tcode{T}'') are different types. The type of a pointer to array of
unknown bound, or of a type defined by a \tcode{typedef} declaration to
be an array of unknown bound, cannot be completed. \begin{example}

\indextext{type!example of incomplete}%
\begin{codeblock}
class X; // \tcode{X} is an incomplete type
Expand Down

0 comments on commit 5d6ff07

Please sign in to comment.