]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/cp/typeck.c
c-common.c (lvalue_or_else): Replace by lvalue_error; only give diagnostic without...
[thirdparty/gcc.git] / gcc / cp / typeck.c
index 1639b54532ba3415c4dcb32899bd3fa318e0113c..c2adb1c7fd469856d37702088f060698d92d060a 100644 (file)
@@ -6513,3 +6513,19 @@ non_reference (tree t)
     t = TREE_TYPE (t);
   return t;
 }
+
+
+/* Return nonzero if REF is an lvalue valid for this language;
+   otherwise, print an error message and return zero.  USE says
+   how the lvalue is being used and so selects the error message.  */
+
+int
+lvalue_or_else (tree ref, enum lvalue_use use)
+{
+  int win = lvalue_p (ref);
+
+  if (!win)
+    lvalue_error (use);
+
+  return win;
+}