This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Testcase for fixed PR c++/2743
- From: Nathanael Nerode <neroden at twcny dot rr dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 1 Jan 2003 16:01:52 -0500
- Subject: Testcase for fixed PR c++/2743
Applied.
+ g++.dg/lookup/exception1.C: New test.
Index: g++.dg/lookup/exception1.C
===================================================================
RCS file: g++.dg/lookup/exception1.C
diff -N g++.dg/lookup/exception1.C
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ g++.dg/lookup/exception1.C 1 Jan 2003 21:01:16 -0000
@@ -0,0 +1,33 @@
+/* PR 2743 */
+/* {dg-do compile} */
+
+namespace ns {
+ class Exception
+ {
+ };
+}
+
+namespace ns
+{
+ class Test {
+ public:
+ inline Test() throw( Exception );
+ inline Test(int n ) throw( Exception );
+ private:
+ int i;
+ };
+}
+
+// This line used to fail because Exception wasn't looked up in the
+// right scope.
+ns::Test::Test() throw( Exception ) : i( 1 )
+{
+}
+
+ns::Test::Test( int n ) throw( Exception ) : i( n )
+{
+}
+
+int main(int argc, char* argv) {
+ ns::Test test;
+}