[cfe-commits] r73287 - in /cfe/trunk/test/CXX/dcl.dcl/dcl.spec: dcl.fct.spec/ dcl.fct.spec/p3.cpp dcl.fct.spec/p4.cpp dcl.fct.spec/p6.cpp dcl.stc/ dcl.stc/p10.cpp dcl.stc/p9.cpp dcl.typedef/ dcl.typedef/p3.cpp dcl.typedef/p4.cpp
Daniel Dunbar
daniel at zuster.org
Fri Jun 12 23:16:37 PDT 2009
Author: ddunbar
Date: Sat Jun 13 01:16:36 2009
New Revision: 73287
URL: http://llvm.org/viewvc/llvm-project?rev=73287&view=rev
Log:
Add some random C++ standard tests.
Added:
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p3.cpp
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p6.cpp
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p10.cpp
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p9.cpp
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p3.cpp
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p4.cpp
Modified:
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/ (props changed)
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.stc/ (props changed)
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/ (props changed)
Propchange: cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Jun 13 01:16:36 2009
@@ -0,0 +1 @@
+Output
Added: cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p3.cpp?rev=73287&view=auto
==============================================================================
--- cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p3.cpp (added)
+++ cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p3.cpp Sat Jun 13 01:16:36 2009
@@ -0,0 +1,11 @@
+// RUN: clang-cc -verify %s
+// XFAIL
+
+void f0(void) {
+ inline void f1(); // expected-error {{'inline' is not allowed on block scope function declaration}}
+}
+
+// FIXME: Add test for "If the inline specifier is used in a friend declaration,
+// that declaration shall be a definition or the function shall have previously
+// been declared inline.
+
Added: cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp?rev=73287&view=auto
==============================================================================
--- cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp (added)
+++ cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp Sat Jun 13 01:16:36 2009
@@ -0,0 +1,7 @@
+// RUN: clang-cc -verify %s
+// XFAIL
+
+void f0() {
+}
+
+inline void f0(); // expected-error {{function definition cannot preceed inline declaration}}
Added: cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p6.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p6.cpp?rev=73287&view=auto
==============================================================================
--- cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p6.cpp (added)
+++ cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p6.cpp Sat Jun 13 01:16:36 2009
@@ -0,0 +1,13 @@
+// RUN: clang-cc -verify %s
+// XFAIL
+
+class A {
+public:
+ explicit A();
+
+ explicit operator int(); // expected-warning {{explicit conversion functions are a C++0x extension}}
+
+ explicit void f0(); // expected-error {{'explicit' cannot only be applied to constructor or conversion function}}
+};
+
+explicit A::A() { } // expected-error {{'explicit' cannot be specified outside class definition}}
Propchange: cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.stc/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Jun 13 01:16:36 2009
@@ -0,0 +1 @@
+Output
Added: cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p10.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p10.cpp?rev=73287&view=auto
==============================================================================
--- cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p10.cpp (added)
+++ cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p10.cpp Sat Jun 13 01:16:36 2009
@@ -0,0 +1,14 @@
+// RUN: clang-cc -verify %s
+// XFAIL
+
+typedef const int T0;
+typedef int& T1;
+
+struct s0 {
+ mutable const int f0; // expected-error{{'mutable' and 'const' cannot be mixed}}
+ mutable T0 f1; // expected-error{{'mutable' and 'const' cannot be mixed}}
+ mutable int &f2; // expected-error{{'mutable' cannot be applied to references}}
+ mutable T1 f3; // expected-error{{'mutable' cannot be applied to references}}
+ mutable struct s1 {}; // expected-error{{'mutable' cannot be applied to non-data members}}
+ mutable void im0(); // expected-error{{'mutable' cannot be applied to functions}}
+};
Added: cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p9.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p9.cpp?rev=73287&view=auto
==============================================================================
--- cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p9.cpp (added)
+++ cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p9.cpp Sat Jun 13 01:16:36 2009
@@ -0,0 +1,12 @@
+// RUN: clang-cc -verify %s
+
+struct S; // expected-note {{forward declaration of 'struct S'}}
+extern S a;
+extern S f();
+extern void g(S a); // expected-note {{candidate function}}
+
+void h() {
+ // FIXME: This diagnostic could be better.
+ g(a); // expected-error {{no matching function for call to 'g'}}
+ f(); // expected-error {{return type of called function ('struct S') is incomplete}}
+}
Propchange: cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Jun 13 01:16:36 2009
@@ -0,0 +1 @@
+Output
Added: cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p3.cpp?rev=73287&view=auto
==============================================================================
--- cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p3.cpp (added)
+++ cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p3.cpp Sat Jun 13 01:16:36 2009
@@ -0,0 +1,8 @@
+// RUN: clang-cc -verify %s
+
+typedef struct s { int x; } s;
+typedef int I;
+typedef int I2;
+typedef I2 I; // expected-note {{previous definition is here}}
+
+typedef char I; // expected-error {{typedef redefinition with different types}}
Added: cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p4.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p4.cpp?rev=73287&view=auto
==============================================================================
--- cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p4.cpp (added)
+++ cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p4.cpp Sat Jun 13 01:16:36 2009
@@ -0,0 +1,9 @@
+// RUN: clang-cc -verify %s
+// XFAIL
+
+struct S {
+ typedef struct A {} A; // expected-note {{previous definition is here}}
+ typedef struct B B;
+ typedef A A; // expected-error {{redefinition of 'A'}}
+};
+
More information about the cfe-commits
mailing list