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

            Bug ID: 50774
           Summary: Clang AST ignores PrintingPolicy for template
                    specialization
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

The problem is regarding clang AST - TypePrinter.cpp here
https://searchfox.org/llvm/rev/cbfb12469ba312c8ff513397b29bef470f151caa/clang/lib/AST/TypePrinter.cpp#1460
always resets full qualification to false (the last argument), thus it is
impossible to print clang::ParmVarDecl::getType() from a
ClassTemplateSpecializationDecl with the namespace the parameter type is
declared in. So for code below getAsString() of the param type returns
"Type<int>" instead of "Namespace::Type<int>", and there is no way to get the
latter as the result (PrintingPolicy is ignored for the template-id codepath).

namespace Namespace {
template<typename T>
struct Type { 
  T Field;
}

template<typename T>
struct Struct {
  void Func(const Type<T> &InType) {
  }
}

int main() {
  Struct<int> Instance;
}

}

Problem found thanks to the help of user nridge in discord.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to