Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AST] Fix nested name specifiers printing as NamespaceNamespace #65266

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

sam-mccall
Copy link
Collaborator

This happens because we print both the kind of the NNS and the kind of
decl (when it refers to one). These are always the same string.

This happens because we print both the kind of the NNS and the kind of
decl (when it refers to one). These are always the same string.
@sam-mccall sam-mccall requested a review from a team as a code owner September 4, 2023 15:00
@philnik777 philnik777 added the clang:frontend Language frontend issues, e.g. anything involving "Sema" label Sep 4, 2023
Copy link
Contributor

@cor3ntin cor3ntin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo one nitpick

@@ -16,6 +16,7 @@
#include "clang/AST/DeclOpenMP.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/LocInfoType.h"
#include "clang/AST/NestedNameSpecifier.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That does not seem necessary

Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sam-mccall sam-mccall merged commit 54091d3 into llvm:main Sep 5, 2023
1 check passed
Copy link
Collaborator

@shafik shafik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but we should test all changes.

dumpBareDeclRef(NNS->getAsNamespace());
break;
case NestedNameSpecifier::NamespaceAlias:
OS << " NamespaceAlias";
OS << " "; // "NamespaceAlias" is printed as the decl kind.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a test that covers this case.

avillega pushed a commit to avillega/llvm-project that referenced this pull request Sep 11, 2023
…#65266)

This happens because we print both the kind of the NNS and the kind of
decl (when it refers to one). These are always the same string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants