Skip to content

Add missing include should prioritize the header with the class definition over headers with only a forward declaration (VS:1906590) #11703

Open
@bobbrow

Description

@bobbrow

Set up a project thusly:

Header.h
class Foo; // just forward declaration

Header2.h
class Foo {}; // the definition

Source.cpp
Foo foo;

Actual:
In the current product, Foo in cpp file should squiggle with "undefined" error and hovering over it offers both headers as suggestions.

Expected:
The suggested includes should be only Header2.h (to bring the full definition)

This should be addressed in VS and VS Code

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions