This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/11658] Wrong error message


------- Additional Comments From bonzini at gnu dot org  2004-02-02 13:44 -------
It is related to this code in c-common.c (c_common_truthvalue_conversion): 
 
When could it be wrong for C++?!?  And do "all callers" now handle ERROR_MARK 
properly? 
 
#if 0 /* This appears to be wrong for C++.  */ 
  /* These really should return error_mark_node after 2.4 is stable. 
     But not all callers handle ERROR_MARK properly.  */ 
  switch (TREE_CODE (TREE_TYPE (expr))) 
    { 
    case RECORD_TYPE: 
      error ("struct type value used where scalar is required"); 
      return truthvalue_false_node; 
 
    case UNION_TYPE: 
      error ("union type value used where scalar is required"); 
      return truthvalue_false_node; 
 
    case ARRAY_TYPE: 
      error ("array type value used where scalar is required"); 
      return truthvalue_false_node; 
 
    default: 
      break; 
    } 
#endif /* 0 */ 
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |bonzini at gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11658


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]