r179537 - [PCH/test] Make test/PCH/cxx-typeid.cpp self-contained by including the relevant standard library declarations

Argyrios Kyrtzidis akyrtzi at gmail.com
Mon Apr 15 09:52:57 PDT 2013


Author: akirtzidis
Date: Mon Apr 15 11:52:57 2013
New Revision: 179537

URL: http://llvm.org/viewvc/llvm-project?rev=179537&view=rev
Log:
[PCH/test] Make test/PCH/cxx-typeid.cpp self-contained by including the relevant standard library declarations
instead of depending on a system header inclusion.

Modified:
    cfe/trunk/test/PCH/cxx-typeid.cpp
    cfe/trunk/test/PCH/cxx-typeid.h

Modified: cfe/trunk/test/PCH/cxx-typeid.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/cxx-typeid.cpp?rev=179537&r1=179536&r2=179537&view=diff
==============================================================================
--- cfe/trunk/test/PCH/cxx-typeid.cpp (original)
+++ cfe/trunk/test/PCH/cxx-typeid.cpp Mon Apr 15 11:52:57 2013
@@ -1,9 +1,9 @@
 // XFAIL: hexagon
 // Test this without pch.
-// RUN: %clang -include %S/cxx-typeid.h -fsyntax-only -Xclang -verify %s
+// RUN: %clang_cc1 -include %S/cxx-typeid.h -fsyntax-only -verify %s
 
-// RUN: %clang -ccc-pch-is-pch -x c++-header -o %t.gch %S/cxx-typeid.h
-// RUN: %clang -ccc-pch-is-pch -include %t -fsyntax-only -Xclang -verify %s 
+// RUN: %clang_cc1 -x c++-header -emit-pch -o %t.pch %S/cxx-typeid.h
+// RUN: %clang_cc1 -include-pch %t.pch -fsyntax-only -verify %s
 
 // expected-no-diagnostics
 

Modified: cfe/trunk/test/PCH/cxx-typeid.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/cxx-typeid.h?rev=179537&r1=179536&r2=179537&view=diff
==============================================================================
--- cfe/trunk/test/PCH/cxx-typeid.h (original)
+++ cfe/trunk/test/PCH/cxx-typeid.h Mon Apr 15 11:52:57 2013
@@ -1,3 +1,44 @@
 // Header for PCH test cxx-typeid.cpp
 
-#include <typeinfo>
+#ifndef CXX_TYPEID_H
+#define CXX_TYPEID_H
+
+namespace std {
+
+class type_info
+{
+public:
+    virtual ~type_info();
+
+    bool operator==(const type_info& rhs) const;
+    bool operator!=(const type_info& rhs) const;
+
+    bool before(const type_info& rhs) const;
+    unsigned long hash_code() const;
+    const char* name() const;
+
+    type_info(const type_info& rhs);
+    type_info& operator=(const type_info& rhs);
+};
+
+class bad_cast
+{
+public:
+    bad_cast();
+    bad_cast(const bad_cast&);
+    bad_cast& operator=(const bad_cast&);
+    virtual const char* what() const;
+};
+
+class bad_typeid
+{
+public:
+    bad_typeid();
+    bad_typeid(const bad_typeid&);
+    bad_typeid& operator=(const bad_typeid&);
+    virtual const char* what() const;
+};
+
+}  // std
+
+#endif





More information about the cfe-commits mailing list