Skip to content

CPP - fields of classes inside namespaces are not parsed correctly in the AST #10972

@Da5hes

Description

@Da5hes

During a modeling of an issue I've encountered a bug:

a.cpp:

#include "b.h"

int gaga_name_map::B::pv(int log, int PCWSTR, int rq)

{
    bool a = mbo;
    return a;
}



int main()
{
    return 0;
}

b.h:

#pragma once

namespace gaga_name_map {
    class B  {
    public:
        static
            int
            g(int log, int PCWSTR, int rq);

    public:
        bool mbo;

    private:
       int pv(int  log, int PCWSTR, int rq);
    };
}

expected result:
the bool 'mbo' is parsed as a filed and/or as a definition in the AST

actual result:
the bool 'mbo' definition in b.h is getting parsed as a MoveAssignmentOp in the AST as can be seen in the photo
image

this reproduces in small and big codebases with both the latest CLI as well as older versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    C++Staleawaiting-responseThe CodeQL team is awaiting further input or clarification from the original reporter of this issue.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions