[cfe-commits] r83588 - in /cfe/trunk: test/CXX/expr/p3.cpp test/CXX/expr/p8.cpp test/CXX/expr/p9.cpp www/cxx_status.html

Douglas Gregor dgregor at apple.com
Thu Oct 8 15:38:14 PDT 2009


Author: dgregor
Date: Thu Oct  8 17:38:14 2009
New Revision: 83588

URL: http://llvm.org/viewvc/llvm-project?rev=83588&view=rev
Log:
Tests for C++ [expr], from James Porter!

Added:
    cfe/trunk/test/CXX/expr/p3.cpp
    cfe/trunk/test/CXX/expr/p8.cpp
    cfe/trunk/test/CXX/expr/p9.cpp
Modified:
    cfe/trunk/www/cxx_status.html

Added: cfe/trunk/test/CXX/expr/p3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/expr/p3.cpp?rev=83588&view=auto

==============================================================================
--- cfe/trunk/test/CXX/expr/p3.cpp (added)
+++ cfe/trunk/test/CXX/expr/p3.cpp Thu Oct  8 17:38:14 2009
@@ -0,0 +1,15 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+double operator +(double, double); // expected-error{{overloaded 'operator+' must have at least one parameter of class or enumeration type}}
+
+struct A
+{
+  operator int();
+};
+
+int main()
+{
+  A a, b;
+  int i0 = a + 1;
+  int i1 = a + b;
+}

Added: cfe/trunk/test/CXX/expr/p8.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/expr/p8.cpp?rev=83588&view=auto

==============================================================================
--- cfe/trunk/test/CXX/expr/p8.cpp (added)
+++ cfe/trunk/test/CXX/expr/p8.cpp Thu Oct  8 17:38:14 2009
@@ -0,0 +1,18 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+int a0;
+const volatile int a1;
+int a2[16];
+int a3();
+
+void f0(int);
+void f1(int *);
+void f2(int (*)());
+
+int main()
+{
+  f0(a0);
+  f0(a1);
+  f1(a2);
+  f2(a3);
+}

Added: cfe/trunk/test/CXX/expr/p9.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/expr/p9.cpp?rev=83588&view=auto

==============================================================================
--- cfe/trunk/test/CXX/expr/p9.cpp (added)
+++ cfe/trunk/test/CXX/expr/p9.cpp Thu Oct  8 17:38:14 2009
@@ -0,0 +1,50 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// floating-point overloads
+
+__typeof__(0 + 0.0L) ld0;
+long double &ldr = ld0;
+
+__typeof__(0 + 0.0) d0;
+double &dr = d0;
+
+__typeof__(0 + 0.0f) f0;
+float &fr = f0;
+
+// integral promotions
+
+signed char c0;
+__typeof__(c0 + c0) c1;
+int &cr = c1;
+
+unsigned char uc0;
+__typeof__(uc0 + uc0) uc1;
+int &ucr = uc1;
+
+short s0;
+__typeof__(s0 + s0) s1;
+int &sr = s1;
+
+unsigned short us0;
+__typeof__(us0 + us0) us1;
+int &usr = us1;
+
+// integral overloads
+
+__typeof__(0 + 0UL) ul0;
+unsigned long &ulr = ul0;
+
+template<bool T> struct selector;
+template<> struct selector<true> { typedef long type; };
+template<> struct selector<false> {typedef unsigned long type; };
+__typeof__(0U + 0L) ui_l0;
+selector<(sizeof(long) > sizeof(unsigned int))>::type &ui_lr = ui_l0;
+
+__typeof__(0 + 0L) l0;
+long &lr = l0;
+
+__typeof__(0 + 0U) u0;
+unsigned &ur = u0;
+
+__typeof__(0 + 0) i0;
+int &ir = i0;

Modified: cfe/trunk/www/cxx_status.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_status.html?rev=83588&r1=83587&r2=83588&view=diff

==============================================================================
--- cfe/trunk/www/cxx_status.html (original)
+++ cfe/trunk/www/cxx_status.html Thu Oct  8 17:38:14 2009
@@ -534,8 +534,8 @@
   <td>5 [expr]</td>
   <td class="na">N/A</td>
   <td class="na">N/A</td>
-  <td class="complete" align="center"></td>
-  <td></td>
+  <td class="complete" align="center">&#x2713;</td>
+  <td class="na">N/A</td>
   <td></td>
 </tr>
 <tr>





More information about the cfe-commits mailing list