Skip to content

Commit f71ff9f

Browse files
authored
Merge pull request #1192 from peterschrammel/various-fixes
Various small fixes
2 parents 12cc79c + 22016c0 commit f71ff9f

File tree

6 files changed

+87
-4
lines changed

6 files changed

+87
-4
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
class B
2+
{
3+
};
4+
5+
class D: public B
6+
{
7+
public:
8+
int x;
9+
};
10+
11+
class E
12+
{
13+
public:
14+
int y;
15+
};
16+
17+
18+
int main(int argc, char** argv)
19+
{
20+
int B::* xptr=static_cast<int B::*>(&D::x);
21+
#if 0
22+
B b;
23+
b.*xptr; // undefined
24+
#endif
25+
26+
D d;
27+
d.*xptr; // valid
28+
29+
return 0;
30+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
KNOWNBUG
2+
main.cpp
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring
9+
--
10+
should exercise cpp_typecheckt::standard_conversion_pointer_to_member, cpp/cpp_typecheck_conversion.cpp:610 once other bugs are fixed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
class B
2+
{
3+
};
4+
5+
class D: public B
6+
{
7+
public:
8+
int x;
9+
};
10+
11+
class E
12+
{
13+
public:
14+
int y;
15+
};
16+
17+
18+
int main(int argc, char** argv)
19+
{
20+
int B::* xptr=static_cast<int B::*>(&D::x);
21+
#if 0
22+
B b;
23+
b.*xptr; // undefined
24+
#endif
25+
26+
E e;
27+
e.*xptr; // compiler error
28+
29+
return 0;
30+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
KNOWNBUG
2+
main.cpp
3+
4+
^EXIT=(64|1)$
5+
^SIGNAL=0$
6+
invalid implicit conversion
7+
^CONVERSION ERROR$
8+
--
9+
^warning: ignoring
10+
--
11+
should exercise cpp_typecheckt::standard_conversion_pointer_to_member, cpp/cpp_typecheck_conversion.cpp:610 once other bugs are fixed

scripts/cpplint.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6516,6 +6516,9 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]):
65166516
if Search(r'_builtin_headers(_[a-z0-9_-]+)?\.h$', filename):
65176517
return
65186518

6519+
if Search(r'regression/.*\.cpp', filename):
6520+
return
6521+
65196522
if not ProcessConfigOverrides(filename):
65206523
_RestoreFilters()
65216524
return

src/goto-instrument/wmm/instrumenter_strategies.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ void inline instrumentert::instrument_one_event_per_cycle_inserter(
136136
continue;
137137

138138
/* instruments the first pair */
139-
for(std::set<event_grapht::critical_cyclet::delayt>::iterator
140-
p_it=it->unsafe_pairs.begin();
141-
p_it!=it->unsafe_pairs.end(); ++p_it)
139+
if(!it->unsafe_pairs.empty())
142140
{
141+
std::set<event_grapht::critical_cyclet::delayt>::iterator
142+
p_it=it->unsafe_pairs.begin();
143143
delayed.insert(*p_it);
144144
const abstract_eventt &first_ev=egraph[p_it->first];
145145
var_to_instr.insert(first_ev.variable);
@@ -154,7 +154,6 @@ void inline instrumentert::instrument_one_event_per_cycle_inserter(
154154
std::pair<irep_idt, source_locationt>(
155155
second_ev.variable, second_ev.source_location));
156156
}
157-
break;
158157
}
159158
}
160159
}

0 commit comments

Comments
 (0)