Skip to content

Find All References thinks two references are different if a template argument has a different typedef #14344

Description

@sean-mcmanus

Repro is find all references on func1 below (found by Copilot via C/C++ DevTools):

test1.h:

template <typename T>
struct vector1 {
    T t;
};
template <typename T>
struct basic_string1 {};
using string1 = basic_string1<char>;

test1.cpp:

#include "test1.h"

void func1(vector1<string1> &a) {}

test2.cpp

#include "test1.h"
using u8string1 = vector1<basic_string1<char>>;
extern void func1(vector1<string1> &a);

int func2()
{
    vector1<string1> v;
    func1(v);
}

Bug: The implementation ends up comparing string1 with u8string1 as not being equal. The bug doesn't repro with VS, which has a different implementation which somehow resolves the comparison correctly.

Image

Metadata

Metadata

Assignees

Labels

Feature: Find All ReferencesFind All References, Peek References, RenameLanguage ServiceWorks in VSSo we'd need to fix it for VS Code to reach parity.bugfixedCheck the Milestone for the release in which the fix is or will be available.

Type

No fields configured for Bug.

Projects

Status
Pull Request

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions