summaryrefslogtreecommitdiff
path: root/test/Frontend/plugin-delayed-template.cpp
blob: c57ec307689793a775f526eba173eef5499d117f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: %clang_cc1 -fdelayed-template-parsing -load %llvmshlibdir/PrintFunctionNames%pluginext -plugin print-fns -plugin-arg-print-fns -parse-template -plugin-arg-print-fns ForcedTemplate %s 2>&1 | FileCheck %s
// REQUIRES: plugins, examples

template <typename T>
void TemplateDep();

// CHECK: top-level-decl: "ForcedTemplate"
// The plugin should force parsing of this template, even though it's
// not used and -fdelayed-template-parsing is specified.
// CHECK: warning: expression result unused
// CHECK: late-parsed-decl: "ForcedTemplate"
template <typename T>
void ForcedTemplate() {
  TemplateDep<T>();  // Shouldn't crash.

  "";  // Triggers the warning checked for above.
}