Skip to content

Commit c7c9837

Browse files
rpoyner-triRussTedrake
authored andcommitted
[parsing] Fix hazard in deprecated API (RobotLocomotion#21567)
1 parent 1547cce commit c7c9837

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

multibody/parsing/parser.h

+7-3
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,13 @@ class Parser final {
198198
return collision_filter_groups_;
199199
}
200200

201-
DRAKE_DEPRECATED("2024-10-01", "Use GetCollisionFilterGroups() instead.")
202-
CollisionFilterGroups collision_filter_groups() const {
203-
return GetCollisionFilterGroups();
201+
DRAKE_DEPRECATED(
202+
"2024-10-01",
203+
"Use GetCollisionFilterGroups() instead. Note that the return type is"
204+
" changed to by-value in the new method; callers may need to store the"
205+
" return value in a variable with an appropriate lifetime.")
206+
const CollisionFilterGroups& collision_filter_groups() const {
207+
return collision_filter_groups_;
204208
}
205209

206210
/// Parses the input file named in @p file_name and adds all of its model(s)

0 commit comments

Comments
 (0)