- Notifications
You must be signed in to change notification settings - Fork70
Closed
Description
Affected rules
A0-1-1
Description
Where anauto variable is declared in a template function or class, the copy of the variable in the uninstantiated template may be considered "unused", even though it is considered used in at least one instantiation.
Example
#include<vector>template<typename T>voidtest_range_based_for_loop_template() { std::vector<A> values_;for (auto &elem : values_) {// COMPLIANT - should not report either elem or// the compiler generated (__range)// variable in the uninstantiated// template elem; }}// Instantiate the templatevoidtest_template() { test_range_based_for_loop_template<A>(); }