[llvm-bugs] [Bug 25423] New: NamedDecl::printQualifiedName includes extra scope for unscoped enums

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 5 15:56:16 PST 2015


https://llvm.org/bugs/show_bug.cgi?id=25423

            Bug ID: 25423
           Summary: NamedDecl::printQualifiedName includes extra scope for
                    unscoped enums
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: saugustine at google.com
                CC: klimek at google.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Consider an unscoped enum, defined within a class:

class aclass{
  enum { x };
};

enumerator_x_decl->getQualifiedName();

returns

aclass::::x

because x's enumeration decl doesn't have a name.

The correct name is:

aclass::x (C++ [dcl.enum]p10).

This is also easy to see with an ast dump, which uses different code to print
the scope:

`-EnumDecl 0x359fd10 <line:2:1, col:10> col:1
  `-EnumConstantDecl 0x359fdc0 <col:8> col:8 x 'enum aclass::(anonymous at
enum.cc:2:1)'

NamedDecl::printQualifiedName should handle unscoped enumerations similar to
how it handles anonymous namespaces. I'll submit a patch shortly to fix this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20151105/f339ee99/attachment.html>


More information about the llvm-bugs mailing list