class RuboCop::Cop::Lint::AmbiguousRegexpLiteral

def on_new_investigation

def on_new_investigation
  processed_source.diagnostics.each do |diagnostic|
    if target_ruby_version >= 3.0
      next unless diagnostic.reason == :ambiguous_regexp
    else
      next unless diagnostic.reason == :ambiguous_literal
    end
    offense_node = find_offense_node_by(diagnostic)
    add_offense(diagnostic.location, severity: diagnostic.level) do |corrector|
      add_parentheses(offense_node, corrector)
    end
  end
end