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

            Bug ID: 35302
           Summary: missing namespaces when underlying type is a template
                    specialization
           Product: clang
           Version: 5.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: unassignedclangb...@nondot.org
          Reporter: istvan.sz...@nng.com
                CC: kli...@google.com, llvm-bugs@lists.llvm.org

I'm trying to analyze c++ header files using libclang python bindings.
The following example illustrates the inconsistent namespace handling in type
aliases.

Sample C++ code:

---------- BEGIN ----------
namespace n{
class MyClass{
};
template<typename T> class MyTemplateClass{
};
}
using namespace n;
using MyClassAlias = MyClass;
using MyTemplateClassAlias = MyTemplateClass<int>;
----------  END  ----------


Sample output generated by libclang python binding:

---------- BEGIN ----------
kind: 'TRANSLATION_UNIT' spelling: 'c:\namespace_bug.h'
  +--kind: 'NAMESPACE' spelling: 'n'
  |  +--kind: 'CLASS_DECL' spelling: 'MyClass'
  |  +--kind: 'CLASS_TEMPLATE' spelling: 'MyTemplateClass'
  |     +--kind: 'TEMPLATE_TYPE_PARAMETER' spelling: 'T'
  +--kind: 'USING_DIRECTIVE'
  |  +--kind: 'NAMESPACE_REF' spelling: 'n'
  +--kind: 'TYPE_ALIAS_DECL' spelling: 'MyClassAlias'
underlying_typedef_type.spelling: 'n::MyClass'
  |  +--kind: 'TYPE_REF' spelling: 'class n::MyClass'
  +--kind: 'TYPE_ALIAS_DECL' spelling: 'MyTemplateClassAlias'
underlying_typedef_type.spelling: 'MyTemplateClass<int>'
     +--kind: 'TEMPLATE_REF' spelling: 'MyTemplateClass'
----------  END  ----------

Namespace is missing from the spelling of underlying type in the second type
alias decl.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to