[cfe-commits] r61059 - in /cfe/trunk: test/SemaCXX/default2.cpp www/cxx_status.html
Douglas Gregor
dgregor at apple.com
Mon Dec 15 16:08:35 PST 2008
Author: dgregor
Date: Mon Dec 15 18:08:34 2008
New Revision: 61059
URL: http://llvm.org/viewvc/llvm-project?rev=61059&view=rev
Log:
Added a test for default arguments added to out-of-line member
functions. They work except that name lookup within the default
arguments needs to be deferred until the class definition is complete
(see FIXME in the test).
Modified:
cfe/trunk/test/SemaCXX/default2.cpp
cfe/trunk/www/cxx_status.html
Modified: cfe/trunk/test/SemaCXX/default2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/default2.cpp?rev=61059&r1=61058&r2=61059&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/default2.cpp (original)
+++ cfe/trunk/test/SemaCXX/default2.cpp Mon Dec 15 18:08:34 2008
@@ -44,3 +44,29 @@
int f(X* x = this); // expected-error{{default argument references 'this'}}
}
};
+
+// C++ [dcl.fct.default]p6
+class C {
+ static int x;
+ void f(int i = 3); // expected-note{{previous definition is here}}
+ void g(int i, int j = x);
+
+ void h();
+};
+void C::f(int i = 3) // expected-error{{redefinition of default argument}}
+{ }
+
+void C::g(int i = 88, int j) {}
+
+void C::h() {
+ g(); // okay
+}
+
+// C++ [dcl.fct.default]p9
+class Y {
+ int a;
+ int mem1(int i = a); // expected-error{{invalid use of nonstatic data member 'a'}}
+ // FIXME: The code below is well-formed.
+ // int mem2(int i = b); // OK; use X::b
+ static int b;
+};
Modified: cfe/trunk/www/cxx_status.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_status.html?rev=61059&r1=61058&r2=61059&view=diff
==============================================================================
--- cfe/trunk/www/cxx_status.html (original)
+++ cfe/trunk/www/cxx_status.html Mon Dec 15 18:08:34 2008
@@ -853,9 +853,9 @@
<td> 8.3.6 [dcl.fct.default]</td>
<td class="advanced" align="center"></td>
<td class="advanced" align="center"></td>
- <td class="medium" align="center"></td>
+ <td class="advanced" align="center"></td>
<td></td>
- <td>Missing default arguments for out-of-line member functions, templates.</td>
+ <td>Missing default arguments for templates.</td>
</tr>
<tr><td> 8.4 [dcl.fct.def]</td><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td> 8.5 [dcl.init]</td><td></td><td></td><td></td><td></td><td></td></tr>
More information about the cfe-commits
mailing list