changeset 19435:9035a36736af

maint: Periodic merge of gui-release to default.
author Rik <rik@octave.org>
date Mon, 15 Dec 2014 21:01:45 -0800
parents 9e5b64b3c1fe (current diff) 9887a930465f (diff)
children 5cd83b466a3e
files libinterp/corefcn/data.cc libinterp/corefcn/module.mk libinterp/parse-tree/pt-mat.cc
diffstat 3 files changed, 19 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/data.cc	Sat Dec 13 18:41:03 2014 -0800
+++ b/libinterp/corefcn/data.cc	Mon Dec 15 21:01:45 2014 -0800
@@ -1930,6 +1930,7 @@
     {
       std::string result_type;
 
+      bool all_strings_p = true;
       bool all_sq_strings_p = true;
       bool all_dq_strings_p = true;
       bool all_real_p = true;
@@ -1951,6 +1952,8 @@
           else
             result_type = get_concat_class (result_type, args(i).class_name ());
 
+          if (all_strings_p && ! args(i).is_string ())
+            all_strings_p = false;
           if (all_sq_strings_p && ! args(i).is_sq_string ())
             all_sq_strings_p = false;
           if (all_dq_strings_p && ! args(i).is_dq_string ())
@@ -2009,9 +2012,13 @@
         {
           char type = all_dq_strings_p ? '"' : '\'';
 
-          maybe_warn_string_concat (all_dq_strings_p, all_sq_strings_p);
-
-          charNDArray result =  do_single_type_concat<charNDArray> (args, dim);
+          if (! all_strings_p)
+            gripe_implicit_conversion ("Octave:num-to-str",
+                                       "numeric", result_type);
+          else
+            maybe_warn_string_concat (all_dq_strings_p, all_sq_strings_p);
+
+          charNDArray result = do_single_type_concat<charNDArray> (args, dim);
 
           retval = octave_value (result, type);
         }
--- a/libinterp/corefcn/module.mk	Sat Dec 13 18:41:03 2014 -0800
+++ b/libinterp/corefcn/module.mk	Mon Dec 15 21:01:45 2014 -0800
@@ -76,7 +76,7 @@
   corefcn/ls-utils.h \
   corefcn/mex.h \
   corefcn/mexproto.h \
-  corefcn/mxarray.in.h \
+  corefcn/mxarray.h \
   corefcn/oct-errno.h \
   corefcn/oct-fstrm.h \
   corefcn/oct-handle.h \
--- a/libinterp/parse-tree/pt-mat.cc	Sat Dec 13 18:41:03 2014 -0800
+++ b/libinterp/parse-tree/pt-mat.cc	Mon Dec 15 21:01:45 2014 -0800
@@ -32,6 +32,7 @@
 #include "data.h"
 #include "defun.h"
 #include "error.h"
+#include "gripes.h"
 #include "oct-obj.h"
 #include "pt-arg-list.h"
 #include "pt-bp.h"
@@ -936,6 +937,7 @@
 {
   octave_value retval = Matrix ();
 
+  bool all_strings_p = false;
   bool all_sq_strings_p = false;
   bool all_dq_strings_p = false;
   bool all_empty_p = false;
@@ -949,6 +951,7 @@
   if (tmp && ! tmp.empty ())
     {
       dim_vector dv = tmp.dims ();
+      all_strings_p = tmp.all_strings_p ();
       all_sq_strings_p = tmp.all_sq_strings_p ();
       all_dq_strings_p = tmp.all_dq_strings_p ();
       all_empty_p = tmp.all_empty_p ();
@@ -993,7 +996,11 @@
         {
           char type = all_dq_strings_p ? '"' : '\'';
 
-          maybe_warn_string_concat (all_dq_strings_p, all_sq_strings_p);
+          if (! all_strings_p)
+            gripe_implicit_conversion ("Octave:num-to-str",
+                                       "numeric", result_type);
+          else
+            maybe_warn_string_concat (all_dq_strings_p, all_sq_strings_p);
 
           charNDArray result (dv, Vstring_fill_char);