Skip to content

Exclude rvalue references from const in AUTOSAR rule 7-1-1. #814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 31, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion cpp/autosar/test/rules/A7-1-1/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,16 @@ template <bool... Args> extern constexpr bool recurse_var = true; // COMPLIANT
template <bool B1, bool... Args>
extern constexpr bool recurse_var<B1, Args...> = B1 &&recurse_var<Args...>;

void fp_621() { recurse_var<true, true, true>; }
void fp_621() { recurse_var<true, true, true>; }

#include <utility>

void variadic_forwarding() {}

template <typename T, typename... Args>
void variadic_forwarding(T &&first, Args &&...rest) {
first;
variadic_forwarding(std::forward<Args>(rest)...);
}

int test_variadic_forwarding() { variadic_forwarding(1, 1.1, "a"); }