File tree Expand file tree Collapse file tree
include/codi/tapes/tagging Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ Changelog {#Changelog}
55 - Features:
66 * Specialization for Eigen math traits.
77
8+ - Bugfix:
9+ * Tag property 'DoNotUse' is now properly reset on overwrite.
10+
811### v3.1.0 - 2026-02-02
912 - Features:
1013 * It is now possible to define custom tape evaluators for all CoDiPack tapes. The evaluators have access to the full
Original file line number Diff line number Diff line change @@ -207,6 +207,7 @@ namespace codi {
207207 } else {
208208 resetTag (lhs.values [i.value ].getTapeData ().tag );
209209 }
210+ lhs.values [i.value ].getTapeData ().properties .reset (TagFlags::DoNotUse);
210211 lhs.values [i.value ].value () = AggregatedTraits::template arrayAccess<i.value >(real);
211212 });
212213 }
@@ -236,6 +237,7 @@ namespace codi {
236237 } else {
237238 resetTag (lhs.cast ().getTapeData ().tag );
238239 }
240+ lhs.cast ().getTapeData ().properties .reset (TagFlags::DoNotUse);
239241
240242 lhs.cast ().value () = rhs.cast ().getValue ();
241243 }
Original file line number Diff line number Diff line change @@ -95,9 +95,12 @@ int main(int nargs, char** args) {
9595 w = w * z;
9696
9797 out << " Do not use error:" << std::endl;
98- tape.setTagPropertyOnVariable (x, codi::TagFlags::DoNotUse);
99- w = func (x, y);
100- tape.clearTagPropertiesOnVariable (x);
98+ Real t = x;
99+ tape.setTagPropertyOnVariable (t, codi::TagFlags::DoNotUse);
100+ w = func (t, y); // Error is thrown.
101+ t = func (x, y); // t is overwritten
102+ w = func (t, y); // Error is not thrown.
103+ w = func (x, y); // Reset w.
101104
102105 out << " Do not change with same value:" << std::endl;
103106 tape.setTagPropertyOnVariable (w, codi::TagFlags::DoNotChange);
You can’t perform that action at this time.
0 commit comments