plugin-delayed-template.cpp 685 B

1234567891011121314151617
  1. // 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
  2. // REQUIRES: plugins, examples
  3. template <typename T>
  4. void TemplateDep();
  5. // CHECK: top-level-decl: "ForcedTemplate"
  6. // The plugin should force parsing of this template, even though it's
  7. // not used and -fdelayed-template-parsing is specified.
  8. // CHECK: warning: expression result unused
  9. // CHECK: late-parsed-decl: "ForcedTemplate"
  10. template <typename T>
  11. void ForcedTemplate() {
  12. TemplateDep<T>(); // Shouldn't crash.
  13. ""; // Triggers the warning checked for above.
  14. }