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

            Bug ID: 38089
           Summary: Crash on templates and using declaration, expected
                    TemplateDecl, found UnresolvedUsingValueDecl
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: rtr...@google.com
                CC: llvm-bugs@lists.llvm.org

test.cpp:
template <typename T>
struct C {
  template<typename U>
  void Get() {}
};

template <typename T>
class A {
  using C<T>::Get;
  void Run() { Get<int>(); }
};

Compiler invocation:
clang test.cpp:

clang/lib/Sema/SemaDecl.cpp
1064        TemplateDecl *TD
1065          = cast<TemplateDecl>((*Result.begin())->getUnderlyingDecl());
1066        IsFunctionTemplate = isa<FunctionTemplateDecl>(TD);
1067        IsVarTemplate = isa<VarTemplateDecl>(TD);

On line 1065, the underlying Decl was expected to be a TemplateDecl.  With the
code provided above, the actual Decl returned was a UnresolvedUsingValueDecl,
leading to an assertion failure inside the cast call.

-- 
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