Nico Weber | 28e0f24 | 2015-05-17 01:07:16 +0000 | [diff] [blame] | 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 | |
| 4 | template <typename T> |
| 5 | void TemplateDep(); |
| 6 | |
| 7 | // CHECK: top-level-decl: "ForcedTemplate" |
| 8 | // The plugin should force parsing of this template, even though it's |
| 9 | // not used and -fdelayed-template-parsing is specified. |
| 10 | // CHECK: warning: expression result unused |
| 11 | // CHECK: late-parsed-decl: "ForcedTemplate" |
| 12 | template <typename T> |
| 13 | void ForcedTemplate() { |
| 14 | TemplateDep<T>(); // Shouldn't crash. |
| 15 | |
| 16 | ""; // Triggers the warning checked for above. |
| 17 | } |