Skip to content

Commit ae6be24

Browse files
author
Daniel Kroening
committed
add noexcept to frequently used constructors
1 parent 6fd77f4 commit ae6be24

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/util/dstring.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class dstringt final
2525
#ifdef __GNUC__
2626
constexpr
2727
#endif
28-
dstringt():no(0)
28+
dstringt() noexcept:no(0)
2929
{
3030
}
3131

src/util/expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class exprt:public irept
4545
typedef std::vector<exprt> operandst;
4646

4747
// constructors
48-
exprt() { }
48+
exprt() noexcept { }
4949
explicit exprt(const irep_idt &_id):irept(_id) { }
5050
exprt(const irep_idt &_id, const typet &_type):irept(_id)
5151
{

src/util/irep.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class irept
103103
bool is_nil() const { return id()==ID_nil; }
104104
bool is_not_nil() const { return id()!=ID_nil; }
105105

106-
explicit irept(const irep_idt &_id)
106+
explicit irept(const irep_idt &_id) noexcept
107107
#ifdef SHARING
108108
:data(&empty_d)
109109
#endif
@@ -113,12 +113,12 @@ class irept
113113

114114
#ifdef SHARING
115115
// constructor for blank irep
116-
irept():data(&empty_d)
116+
irept() noexcept:data(&empty_d)
117117
{
118118
}
119119

120120
// copy constructor
121-
irept(const irept &irep):data(irep.data)
121+
irept(const irept &irep) noexcept:data(irep.data)
122122
{
123123
if(data!=&empty_d)
124124
{
@@ -135,7 +135,7 @@ class irept
135135
// Copy from rvalue reference.
136136
// Note that this does avoid a branch compared to the
137137
// standard copy constructor above.
138-
irept(irept &&irep):data(irep.data)
138+
irept(irept &&irep) noexcept:data(irep.data)
139139
{
140140
#ifdef IREP_DEBUG
141141
std::cout << "COPY MOVE\n";
@@ -165,7 +165,7 @@ class irept
165165
#ifdef USE_MOVE
166166
// Note that the move assignment operator does avoid
167167
// three branches compared to standard operator above.
168-
irept &operator=(irept &&irep)
168+
irept &operator=(irept &&irep) noexcept
169169
{
170170
#ifdef IREP_DEBUG
171171
std::cout << "ASSIGN MOVE\n";

0 commit comments

Comments
 (0)