From 023d79165d0f1cdee5d88beba021057728ea4424 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 29 Jul 2014 00:51:47 +0000 Subject: [PATCH] [modules] Add missing #include, found by modules build. We need a class definition in order to apply isa<...>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214151 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Sema/ScopeInfo.h | 3 +-- test/Modules/Inputs/cxx-templates-a.h | 7 +++++++ test/Modules/Inputs/cxx-templates-b.h | 1 + test/Modules/cxx-templates.cpp | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/clang/Sema/ScopeInfo.h b/include/clang/Sema/ScopeInfo.h index f2095b6760..d65b1f2cda 100644 --- a/include/clang/Sema/ScopeInfo.h +++ b/include/clang/Sema/ScopeInfo.h @@ -15,6 +15,7 @@ #ifndef LLVM_CLANG_SEMA_SCOPE_INFO_H #define LLVM_CLANG_SEMA_SCOPE_INFO_H +#include "clang/AST/Expr.h" #include "clang/AST/Type.h" #include "clang/Basic/CapturedStmt.h" #include "clang/Basic/PartialDiagnostic.h" @@ -41,8 +42,6 @@ class SwitchStmt; class TemplateTypeParmDecl; class TemplateParameterList; class VarDecl; -class DeclRefExpr; -class MemberExpr; class ObjCIvarRefExpr; class ObjCPropertyRefExpr; class ObjCMessageExpr; diff --git a/test/Modules/Inputs/cxx-templates-a.h b/test/Modules/Inputs/cxx-templates-a.h index cfb8902db1..0289c8ada8 100644 --- a/test/Modules/Inputs/cxx-templates-a.h +++ b/test/Modules/Inputs/cxx-templates-a.h @@ -75,3 +75,10 @@ template struct MergeTemplateDefinitions { template constexpr int MergeTemplateDefinitions::f() { return 1; } template using AliasTemplate = T; + +template struct PartiallyInstantiatePartialSpec {}; +template struct PartiallyInstantiatePartialSpec { + static T *foo() { return reinterpret_cast(0); } + static T *bar() { return reinterpret_cast(0); } +}; +typedef PartiallyInstantiatePartialSpec PartiallyInstantiatePartialSpecHelper; diff --git a/test/Modules/Inputs/cxx-templates-b.h b/test/Modules/Inputs/cxx-templates-b.h index 802b9262d8..5dbf1a1121 100644 --- a/test/Modules/Inputs/cxx-templates-b.h +++ b/test/Modules/Inputs/cxx-templates-b.h @@ -73,4 +73,5 @@ template void UseDefinedInBImplIndirectly(T &v) { void TriggerInstantiation() { UseDefinedInBImpl(); Std::f(); + PartiallyInstantiatePartialSpec::foo(); } diff --git a/test/Modules/cxx-templates.cpp b/test/Modules/cxx-templates.cpp index cbe9f35089..b5036ff956 100644 --- a/test/Modules/cxx-templates.cpp +++ b/test/Modules/cxx-templates.cpp @@ -105,6 +105,7 @@ void g() { int &p = WithPartialSpecializationUse().f(); int &q = WithExplicitSpecializationUse().inner_template(); + int *r = PartiallyInstantiatePartialSpec::bar(); } static_assert(Outer::Inner::f() == 1, ""); -- 2.40.0