Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Ctor name in a ctor call expression gets resolved to CPPClassType instead of CPPConstructor

I've also discovered the convertClassToContructor method. I've tried to change it and encountered a half dosen broken tests. Will investigate the breakages.


On Tue, Oct 30, 2012 at 9:34 AM, Schorn, Markus <Markus.Schorn@xxxxxxxxxxxxx> wrote:

Hi Sergey,

Primarily the name is resolved to the class-type, however in CPPSemantics.postResolution() an attempt is made to replace the class-type with a constructor where this is feasible.

It looks like the check whether the replacement shall  be made or not is incomplete. (this is done in method convertClassToContructor(IASTName)).


Note: By the c++ standard, ‘C(1)’ is actually an explicit type conversion in functional notation (5.2.3). In CDT we model it as a function call _expression_. (By doing that we avoid performing an ambiguity resolution on each and every function call.)





From: sprigogin@xxxxxxxxxx [mailto:sprigogin@xxxxxxxxxx] On Behalf Of Sergey Prigogin
Sent: Monday, October 29, 2012 7:23 PM
To: Schorn, Markus

Cc: CDT General developers list.
Subject: Ctor name in a ctor call _expression_ gets resolved to CPPClassType instead of CPPConstructor


I've noticed that a constructor name in a constructor call _expression_ gets resolved to CPPClassType instead of CPPConstructor. In the following code select "A" in "A(1)". Notice that "A" gets highlighted in the first and the fourth lines, but not in the second line (see
struct A {
  A(int x);
A a = A(1);
This may seem like a minor annoyance, but it causes bug 393068.
Is it the expected behavior? If so, how to get the constructor being called?

Back to the top