Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Compiler Error C3541

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C3541.

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;  
}  

auto Keyword
/Zc:auto (Deduce Variable Type)
typeid

Show:
© 2017 Microsoft