//===----------------------------------------------------------------------===/
#include "Sema.h"
+#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Expr.h"
#include "clang/AST/DeclTemplate.h"
// Exit the scope of this instantiation.
CurContext = PreviousContext;
+ if (!Invalid)
+ Consumer.HandleTagDeclDefinition(Instantiation);
+
// If this is an explicit instantiation, instantiate our members, too.
if (!Invalid && ExplicitInstantiation) {
Inst.Clear();
//
//===----------------------------------------------------------------------===/
#include "Sema.h"
+#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/DeclVisitor.h"
/*IsInstantiation=*/true);
CurContext = PreviousContext;
+
+ DeclGroupRef DG(Function);
+ Consumer.HandleTopLevelDecl(DG);
}
/// \brief Instantiate the definition of the given variable from its
--- /dev/null
+// RUN: clang-cc -emit-llvm -femit-all-decls -o %t %s &&
+// RUN: grep "_ZNK4plusIillEclERKiRKl" %t | count 1
+
+template<typename T, typename U, typename Result>
+struct plus {
+ Result operator()(const T& t, const U& u) const {
+ return t + u;
+ }
+};
+
+template struct plus<int, long, long>;