Q:

is it fine to use auto keyword in function parameter?

I know that meaning of auto keyword has been changed completely from C++11. But Recently I wrote a following simple program that compiles & runs fine when compiling with =std=c++98 option.
#include <iostream>
void fun(auto int a)
{   
    a=3;
    std::cout<<a<<'\n';
}
int main()
{
    fun(3);
}

Orwell Dev C++ IDE gives me warning like following:
[Warning] 'auto' changes meaning in C++11; please remove it [-Wc++0x-compat]

So, is it fine to use auto for function parameters or should I never use auto like this as in above program to maintain compatibility with C++11?

A:

Until C++ 11 the auto keyword was a "storage class specifier" whereas with C++ 11 it becomes a type-induction specifier.
To answer your question: depending on the C++ standard you use to compile your code, adjust the use of the auto keyword accordingly. It's not portable across the pre/post C++ 11 boundary of the C++ standard.

A:

So, is it fine to use auto for function parameters or should I never use auto like this as in above program to maintain compatibility with C++11?

That depends on what you mean by "fine":
If you mean "will it compile?" then YES.
If you mean "is it a good practice", the answer is that it is not a practice at all; It was possible to do so and the code was perfectly valid (before C++11) but that time is passed, and I do not know of anyone who did this (not even for tricky interview questions).
In conclusion, don't do it.

