summaryrefslogtreecommitdiffstats
path: root/tests/cxx/fullinfo_for_templates.cc
blob: 79e42c59fb99296add61f5168125131abc5eaca2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//===--- fullinfo_for_templates.cc - test input file for iwyu -------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// Test that when a template is typedef'd that the location of the definition, not
// any forward declaration, is included.

// First include the file containing the definition of TemplateClass.
#include "tests/cxx/fullinfo_for_templates-d1.h"
// Then include a file containing a forward declaration of TemplateClass.
#include "tests/cxx/fullinfo_for_templates-d2.h"
// IWYU requires full info when typedefing a template.
typedef TemplateClass<int> tc_int;

/**** IWYU_SUMMARY

tests/cxx/fullinfo_for_templates.cc should add these lines:

tests/cxx/fullinfo_for_templates.cc should remove these lines:
- #include "tests/cxx/fullinfo_for_templates-d2.h"  // lines XX-XX

The full include-list for tests/cxx/fullinfo_for_templates.cc:
#include "tests/cxx/fullinfo_for_templates-d1.h"  // for TemplateClass

***** IWYU_SUMMARY */