WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Not capturing the declaration of a variable within a switch condition #36

@EnderHubris

Description

@EnderHubris

C++:

int main() {
  int a = 2;
  switch(int b = 4; a+b) {
    ...
  }
}

The srcML XML of the condition looks like:

<condition>(<decl><type><name>int</name></type> <name>b</name> <init>= <expr><name>a</name> <operator>+</operator> <literal type="number">4</literal></expr></init></decl>; a+b)</condition>

srcSlice when it gives this XML to Dispatcher, srcSlice does not receive data about the decl within the condition of the switch causing srcSlice not to generate a slice for b.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions