Share via

decltype(long long()) trigger compilation error.

周 瑶 41 Reputation points
2022-09-23T08:13:40.91+00:00
decltype(long long()) x = 5;  
decltype((long long())) x = 5;  

Both trigger comilation error. I'm wondering if this is an expected beheavior of C++ standard.

Developer technologies | C++
Developer technologies | C++

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.


Answer accepted by question author

Minxin Yu 13,516 Reputation points Microsoft External Staff
2022-09-26T01:44:18.063+00:00

Hi, @周 瑶

Welcome to Microsoft Q&A!
The problem is caused by Conformance Mode: Yes (/permissive-). Change it to No (/permissive).

Best regards,

Minxin Yu


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.