r214151 - [modules] Add missing #include, found by modules build. We need a class

Richard Smith richard-llvm at metafoo.co.uk
Mon Jul 28 17:51:48 PDT 2014


Author: rsmith
Date: Mon Jul 28 19:51:47 2014
New Revision: 214151

URL: http://llvm.org/viewvc/llvm-project?rev=214151&view=rev
Log:
[modules] Add missing #include, found by modules build. We need a class
definition in order to apply isa<...>.

Modified:
    cfe/trunk/include/clang/Sema/ScopeInfo.h
    cfe/trunk/test/Modules/Inputs/cxx-templates-a.h
    cfe/trunk/test/Modules/Inputs/cxx-templates-b.h
    cfe/trunk/test/Modules/cxx-templates.cpp

Modified: cfe/trunk/include/clang/Sema/ScopeInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/ScopeInfo.h?rev=214151&r1=214150&r2=214151&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/ScopeInfo.h (original)
+++ cfe/trunk/include/clang/Sema/ScopeInfo.h Mon Jul 28 19:51:47 2014
@@ -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;

Modified: cfe/trunk/test/Modules/Inputs/cxx-templates-a.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/cxx-templates-a.h?rev=214151&r1=214150&r2=214151&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/cxx-templates-a.h (original)
+++ cfe/trunk/test/Modules/Inputs/cxx-templates-a.h Mon Jul 28 19:51:47 2014
@@ -75,3 +75,10 @@ template<typename T> struct MergeTemplat
 template<typename T> constexpr int MergeTemplateDefinitions<T>::f() { return 1; }
 
 template<typename T> using AliasTemplate = T;
+
+template<typename T> struct PartiallyInstantiatePartialSpec {};
+template<typename T> struct PartiallyInstantiatePartialSpec<T*> {
+  static T *foo() { return reinterpret_cast<T*>(0); }
+  static T *bar() { return reinterpret_cast<T*>(0); }
+};
+typedef PartiallyInstantiatePartialSpec<int*> PartiallyInstantiatePartialSpecHelper;

Modified: cfe/trunk/test/Modules/Inputs/cxx-templates-b.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/cxx-templates-b.h?rev=214151&r1=214150&r2=214151&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/cxx-templates-b.h (original)
+++ cfe/trunk/test/Modules/Inputs/cxx-templates-b.h Mon Jul 28 19:51:47 2014
@@ -73,4 +73,5 @@ template<typename T> void UseDefinedInBI
 void TriggerInstantiation() {
   UseDefinedInBImpl<void>();
   Std::f<int>();
+  PartiallyInstantiatePartialSpec<int*>::foo();
 }

Modified: cfe/trunk/test/Modules/cxx-templates.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/cxx-templates.cpp?rev=214151&r1=214150&r2=214151&view=diff
==============================================================================
--- cfe/trunk/test/Modules/cxx-templates.cpp (original)
+++ cfe/trunk/test/Modules/cxx-templates.cpp Mon Jul 28 19:51:47 2014
@@ -105,6 +105,7 @@ void g() {
 
   int &p = WithPartialSpecializationUse().f();
   int &q = WithExplicitSpecializationUse().inner_template<int>();
+  int *r = PartiallyInstantiatePartialSpec<int*>::bar();
 }
 
 static_assert(Outer<int>::Inner<int>::f() == 1, "");





More information about the cfe-commits mailing list