pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/help Explained an error message from g++ that occur...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f2f229c29ef5
branches:  trunk
changeset: 537342:f2f229c29ef5
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Jan 06 18:03:16 2008 +0000

description:
Explained an error message from g++ that occurs quite often.

diffstat:

 mk/help/c++.help |  36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diffs (40 lines):

diff -r 62c85ce5ef7b -r f2f229c29ef5 mk/help/c++.help
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/help/c++.help  Sun Jan 06 18:03:16 2008 +0000
@@ -0,0 +1,36 @@
+# $NetBSD: c++.help,v 1.1 2008/01/06 18:03:16 rillig Exp $
+
+# This file contains typical error messages from C++ compilers and
+# instructions how to fix them properly.
+
+# === ISO C++ forbits declaration of '%s' with no type ===
+#
+# This g++ error message appears when a variable is declared, but the
+# type of the variable has not been defined before.
+#
+# A common cause is that the type has been "declared" implicitly in a
+# friend declaration of a class. Up to g++3, this friend declaration
+# was also an implicit class declaration. Starting with g++4, this is no
+# longer the case.
+#
+# Now you have to declare the friend class twice: Once to say that it is
+# a class, and twice to say that it is a friend. Example:
+#
+# Wrong:
+#
+#      class Me {
+#              friend class You;
+#      };
+#
+#      You look_great;
+#
+# Correct:
+#
+#      class You;                      // <-- new
+#      class Me {
+#              friend class You;
+#      };
+#
+#      You look_great;
+#
+# Keywords: ISO C++ forbids declaration type friend



Home | Main Index | Thread Index | Old Index