| title | Compiler Error C3541 | |
|---|---|---|
| ms.date | 11/04/2016 | |
| f1_keywords |
|
|
| helpviewer_keywords |
|
|
| ms.assetid | 252cfd4c-5fd2-415e-a17d-6b0c254350db |
'type': typeid cannot be applied to a type that contains 'auto'
The typeid operator cannot be applied to the indicated type because it contains the auto specifier.
The following example yields C3541.
// C3541.cpp
// Compile with /Zc:auto
#include <typeinfo>
int main() {
auto x = 123;
typeid(x); // OK
typeid(auto); // C3541
return 0;
}