Skip to content

msvc mode C++23 deduced type construction with auto(x) and auto{x} gives an IntelliSense error #14041

@sean-mcmanus

Description

@sean-mcmanus

I can't seem to find a GitHub issue on this: https://developercommunity.visualstudio.com/t/C23-deduced-type-construction-with-aut/10947734

Use a c++23 with msvc mode with test.cpp

void func()
{
	auto v1 = auto(42); // cl.exe compilers, but IntelliSense gives "expected an expression"
	auto v2 = auto{ 42 }; // cl.exe compilers, but IntelliSense gives "expected an expression"
}

Bug: IntelliSense reports the error “expected an expression” but it compiles.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language ServiceVisual StudioInherited from Visual StudiobugfixedCheck the Milestone for the release in which the fix is or will be available.

    Type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions