Intellisense issue with C++17 standard

Hi,

 

I get a red underline that says: "Ambiguous symbol 'std::vector<int>'". This was not the case before upgrading my visual studio to the latest(15.8).

The code compiles fine.

Here is the smallest possible way to reproduce this issue with the latest standard. (/std:c++latest compile flag)

 

#include <memory>
#include <vector>

int main()
{
    auto bla = std::vector<std::string>(); //underline saying: "Ambiguous symbol 'std::vector<std::string>'"
    std::shared_ptr<int> bla;//underline saying: "Ambiguous symbol 'std::shared_ptr<int>'"
    auto bla1 = std::make_shared<std::vector<int>>(); //underline saying: "Ambiguous symbol 'std::vector<int>'"
    
    return 0;
}

If I take the flag out to use the latest standard, the intellisense issue goes away:

I'm not sure what other information I can provide to help?

 

Thanks!

3
14 comments
Avatar
Permanently deleted user

Same thing happens for me also when '/std:c++17' is used.

By analyzing headers I see that it has some overloads (possibly new or changed in VS 15.8) of many containers and other STL stuff under '#if _HAS_CXX17 ... #endif' conditions. Same warning shows up if I run "Inspect this -> Code issues" on such file.

If Resharper is turned off then no warning is shown.

 

0
Avatar
Permanently deleted user

Hello,

R++ 2018.1 does not support class template argument deduction, and gets confused by deduction guides in the standard library.

Please upgrade to R++ 2018.2 which should be out next week, or install the release candidate from https://www.jetbrains.com/resharper/eap/.

Thanks!

0

Hi,

I use R++ 2020.1.3 and the issue is always the same.

0
Avatar
Permanently deleted user

Simo Palacino Hello! Your report is not very useful. Please describe the details - what kind of project you're working on, share a way to reproduce if you can, show the source code on which the issue occurs, etc.

0

I also get these everywhere. Noticed it happened when math.h was included from some other include file, so pared it down to this.

//#include <math.h>
#include <corecrt.h>

#include <memory>
#include <string>
#include <vector>

int main()
{
auto bla = std::vector<std::string>();
std::shared_ptr<int> bla2;//underline saying: "Ambiguous symbol 'std::shared_ptr<int>'"
auto bla1 = std::make_shared<std::vector<int>>(); //underline saying: "'std::vector<int>' does not name a value"

return 0;
}

Standard VS2019 project with C++17, though I made a new project with the same settings and the same source file and I could not reproduce it there.

0
Avatar
Permanently deleted user

@Audun Ellertsen Please try to reproduce this on a project you can share with us. Did you perhaps update Visual Studio? Clearing ReSharper caches and reopening the project might help.

0

I have the same issue here, VS2017 and VisualGDB, Resharper 2020.3.2 with a linux project for a Raspberry Pi.

This happens with a vector, or other elements from the STL.

I can provide a test project.

0
Avatar
Permanently deleted user

Could be https://youtrack.jetbrains.com/issue/RSCPP-31542, please try a 2021.1 EAP build. If it does not help, please send us a repro.

0

After installation I receive an exception from Resharper when I start Visual Studio.

---------------------------
ReSharper – Runtime Error – Technical Data
---------------------------
JetBrains ReSharper has encountered a runtime error.
Technical data follows.
Hint: Ctrl+C copies the text of system message boxes to Clipboard.
________________________________________________________________

The component JetBrains.VsIntegration.Shell.Package.VsPackageUniversalActionHandlers constructor requires System.Lazy`1[JetBrains.VsIntegration.Shell.ActionManagement.VsCommandIdMapping], which we do not have.

 

--- EXCEPTION #1/2 [InvalidOperationException]

Message = “The component JetBrains.VsIntegration.Shell.Package.VsPackageUniversalActionHandlers constructor requires System.Lazy`1[JetBrains.VsIntegration.Shell.ActionManagement.VsCommandIdMapping], which we do not have.”

ExceptionPath = Root.InnerException

ClassName = System.InvalidOperationException

Data.RejectedConstructors.#0.UnsatisfiedTypes.#0 = “System.Lazy`1[[JetBrains.VsIntegration.Shell.ActionManagement.VsCommandIdMapping, JetBrains.Platform.VisualStudio.Core, Version=777.0.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”

Data.RejectedConstructors.#0.Signature = “Void .ctor(JetBrains.Lifetimes.Lifetime, JetBrains.VsIntegration.Shell.Package.VsPackageCommandTargetHandlers, JetBrains.Application.BuildScript.Application.IWindowBranding, JetBrains.Application.Environment.Components.SuspendResume, JetBrains.Application.Environment.JetEnvironment, System.Lazy`1[JetBrains.VsIntegration.Shell.ActionManagement.VsCommandIdMapping], JetBrains.Application.Environment.ApplicationShutdownRequests)”

HResult = COR_E_INVALIDOPERATION=80131509

 

--- Outer ---

 

--- EXCEPTION #2/2 [LoggerException]

Message = “The component JetBrains.VsIntegration.Shell.Package.VsPackageUniversalActionHandlers constructor requires System.Lazy`1[JetBrains.VsIntegration.Shell.ActionManagement.VsCommandIdMapping], which we do not have.”

ExceptionPath = Root

ClassName = JetBrains.Util.LoggerException

Data.ManagedThreadName = <NULL>

InnerException = “Exception #1 at Root.InnerException”

HResult = COR_E_APPLICATION=80131600

StackTraceString = “

bei JetBrains.Application.Components.SignatureResolution.BindToMethod(MethodBase[] candidates, IValueResolveContext context, Object origin)

bei JetBrains.Application.Components.SignatureResolution.BindToConstructor(Type type, IValueResolveContext context)

bei JetBrains.Application.Extensibility.PartCatalogTypeComponentDescriptor.CreateInstanceOf(Type type, IValueResolveContext context)

bei JetBrains.Application.Extensibility.PartCatalogTypeComponentDescriptor.CreateInstance(IValueResolveContext context)

bei JetBrains.Application.Components.SingletonDescriptor.CreateInstanceChecked(OnError onError, IComponentContainer container)

bei JetBrains.Application.Components.SingletonDescriptor.GetValue()

bei JetBrains.Application.Components.InitializationStrategyDefault.Schedule(Lifetime lifetime, ICollection`1 dscs, IComponentContainer container)

bei JetBrains.Application.Components.ComponentStorage.ComposeDescriptors(ICollection`1 descriptors)

bei JetBrains.Application.Components.ComponentStorage.Compose()

bei JetBrains.Application.Environment.JetEnvironment..ctor(Lifetime lifetime, JetHostParametersCaller host)

bei JetBrains.Application.Environment.JetEnvironment.<>c__DisplayClass8_0.<InternalCreate>b__0()

bei JetBrains.Threading.ReentrancyGuard.Execute(String name, Action action)

bei JetBrains.Application.Environment.JetEnvironment.InternalCreate(LifetimeDefinition lifetimeDefinition, JetHostParametersCaller host, JetEnvironment& environment)

bei JetBrains.Application.Environment.JetEnvironment.<>c__DisplayClass6_0.<CreateDontRun>b__0()

bei JetBrains.Lifetimes.LifetimeDefinition.Bracket(Action opening, Action closing)

bei JetBrains.Lifetimes.Lifetime.Bracket(Action opening, Action closing)

bei JetBrains.Lifetimes.Lifetime.AddBracket(Action FOpening, Action FClosing)

bei JetBrains.Application.Environment.JetEnvironment.CreateDontRun(Lifetime lifetime, JetHostParameters hostparams)

bei JetBrains.VsIntegration.Shell.Package.VsPackage.Init_CreateHostAndEnvironment(Lifetime lifetime, IServiceProvider site)

bei JetBrains.VsIntegration.Shell.Package.VsPackage.<.ctor>b__3_0(Lifetime lifeHaveSite, IServiceProvider site)

bei JetBrains.DataFlow.IPropertyEx.<>c__DisplayClass29_0`1.<ForEachValue>b__0(Lifetime lf, TValue value, Object cookie)

bei JetBrains.DataFlow.IPropertyEx.<>c__DisplayClass30_1`1.<ForEachValue>b__1(Lifetime lifetimeValue)

bei JetBrains.Lifetimes.SequentialLifetimes.<>c__DisplayClass4_0.<Next>b__0(LifetimeDefinition lifetimeDefinition)

bei JetBrains.Lifetimes.LifetimeDefinition.ExecuteOrTerminateOnFail(Action`1 atomicAction)

bei JetBrains.Lifetimes.SequentialLifetimes.<>c__DisplayClass5_0.<DefineNext>b__0(LifetimeDefinition definition)

bei JetBrains.Lifetimes.SequentialLifetimes.TrySetNewAndTerminateOld(LifetimeDefinition newLifetimeDefinition, Action`1 actionWithNewLifetime)

bei JetBrains.Lifetimes.SequentialLifetimes.DefineNext(Action`1 atomicAction)

bei JetBrains.Lifetimes.SequentialLifetimes.Next(Action`1 atomicAction)

bei JetBrains.DataFlow.IPropertyEx.<>c__DisplayClass30_0`1.<ForEachValue>b__0(PropertyChangedEventArgs`1 args)

bei JetBrains.DataFlow.Signal`1.NotifySinks(TValue payload)

bei JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie)

bei JetBrains.DataFlow.Property`1.FireChange(TValue old, TValue new, Object cookie)

bei JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)

bei JetBrains.DataFlow.Property`1.set_Value(TValue value)

bei JetBrains.VsIntegration.Shell.Package.VsPackageSdkStub.<.ctor>b__11_5()

bei JetBrains.Threading.JetDispatcher.Closure.Execute()

bei JetBrains.Util.Concurrency.WinJetDispatcher.ProcessQueue(Int32 nMinBucket)

bei JetBrains.Util.Concurrency.WinJetDispatcher.ExternalIdleProcessing.OnExternalDriverIdle()

bei JetBrains.VsIntegration.Shell.VsDoIdleDispatcherSink.Microsoft.VisualStudio.OLE.Interop.IOleComponent.FDoIdle(UInt32 grfidlef)


---------------------------
OK
---------------------------

0
Avatar
Permanently deleted user

A Boettcher Sorry, it looks like this issue happens with EAP builds when only ReSharper C++ is installed without the main ReSharper (https://youtrack.jetbrains.com/issue/RSCPP-31653). 

0

I installed EAP and main Resharper, and still get "Ambiguous symbol".

How can I send you a test project?

0
Avatar
Permanently deleted user

Upload the project to https://uploads.jetbrains.com/ and let us know the upload id, or create a new issue in the issue tracker (https://youtrack.jetbrains.com/issues?q=%23RSCPP).

0

The upload id is: 2021_03_04_XNLFRQ96jrv73LcB

0
Avatar
Permanently deleted user

Thanks, I've created https://youtrack.jetbrains.com/issue/RSCPP-31729. Note that R++ does not have good compatibility with VisualGDB projects at the moment.

0

Please sign in to leave a comment.