[Bug libstdc++/54468] New: type trait is_unsigned<...>::value for C++11 enum class with underlying unsigned type not true

2012-09-03 Thread mhcox at bluezoosoftware dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54468

 Bug #: 54468
   Summary: type trait is_unsigned<...>::value for C++11 enum
class with underlying unsigned type not true
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: mh...@bluezoosoftware.com


The is_unsigned<> type trait is not detecting the underlying signedness of a
C++11 enum class or enum.

The output of:

#include 
#include 

using namespace std;

int main()
{
   enum class enum_class_type: unsigned char
   {
   ENUM_CLASS_VALUE0,
   ENUM_CLASS_VALUE1
   };
   cout << boolalpha << "is_enum::value = " <<
is_enum::value << endl;
   cout << "is_unsigned::value = " <<
is_unsigned::value << endl;

   enum enum_type: unsigned char
   {
   ENUM_VALUE0,
   ENUM_VALUE1
   };
   cout << boolalpha << "is_enum::value = " <<
is_enum::value << endl;
   cout << "is_unsigned::value = " << is_unsigned::value
<< endl;
}

should be:

is_enum::value = true
is_unsigned::value = true
is_enum::value = true
is_unsigned::value = true

but is:

is_enum::value = true
is_unsigned::value = false
is_enum::value = true
is_unsigned::value = false


[Bug libstdc++/54468] type trait is_unsigned<...>::value for C++11 enum class with underlying unsigned type not true

2012-09-04 Thread mhcox at bluezoosoftware dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54468

Michael H. Cox  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID

--- Comment #2 from Michael H. Cox  
2012-09-04 19:01:08 UTC ---
OK, sorry for the distraction.


[Bug libstdc++/58357] New: In C++11 std::rotate(first, middle, last) now should return a forward iterator to first + (last - middle).

2013-09-07 Thread mhcox at bluezoosoftware dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58357

Bug ID: 58357
   Summary: In C++11 std::rotate(first, middle, last) now should
return a forward iterator to  first + (last - middle).
   Product: gcc
   Version: 4.8.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mhcox at bluezoosoftware dot com

According to section 25.3.11, the rotate(first, middle, last) algorithm should
return a forward iterator that points to (first + (last - middle)).

Compiled with -std=c++11.


[Bug c++/21901] New: Nested class has access to Nestee's private member functions

2005-06-03 Thread mhcox at bluezoosoftware dot com
When compiling the following code I get no error (should get access violation 
on bar's constructor's access of foo's private foobar() ):
# 1 "bug050603.cc"
# 1 ""
# 1 ""
# 1 "bug050603.cc"
class foo
{
public:
  foo() { }

  class bar
  {
  public:
bar() { foo::foobar(); }
  };

private:
  static int foobar();
};

Note that this problems also occurs in 3.3.1 on a Solaris 2.6 Sparc box.  I 
don't have access to any newer compilers to see if it's fixed in latter 
releases.

I found one bug (12226) that sounds related.

Output of g++ -v:
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr --exec-
prefi
x=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --
mandir=/usr/s
hare/man --infodir=/usr/share/info --enable-
languages=c,ada,c++,d,f77,java,objc,
pascal --enable-nls --without-included-gettext --enable-libgcj --with-system-
zli
b --enable-interpreter --enable-threads=posix --enable-java-gc=boehm --enable-
sj
lj-exceptions --disable-version-specific-runtime-libs --disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)

-- 
   Summary: Nested class has access to Nestee's private member
functions
   Product: gcc
   Version: 3.3.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mhcox at bluezoosoftware dot com
CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin


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


[Bug c++/21901] Nested class has access to Nestee's private member functions

2005-06-04 Thread mhcox at bluezoosoftware dot com

--- Additional Comments From mhcox at bluezoosoftware dot com  2005-06-04 
17:17 ---
Subject: RE:  Nested class has access to Nestee's private member functions

>From my copy of the C++ standard (ISO/IEC 14882:1998(E)) [class.access.net]
11.8.1:

The members of a nested class have no special access to members of
an enclosing class, nor to classes or
Functions that have granted friendship to an enclosing class; the
usual access ruls (clause 11) shal be
Obeyed.  The members of an enclosing class have no special access to
members of a nested class; the usual
Access rules (clause 11) shall be obeyed.

I read suggestions that this should be changed in the next standard, but I
don't think it's changed yet.  Therefore, the resolution shouldn't be
INVALID.  It either needs to fixed or documented as a non-standard extension
(in anticipation of the next standard's changes).

Mike





 

-Original Message-
From: bangerth at dealii dot org [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 03, 2005 11:46 AM
To: [EMAIL PROTECTED]
Subject: [Bug c++/21901] Nested class has access to Nestee's private member
functions


--- Additional Comments From bangerth at dealii dot org  2005-06-03
17:46 --- Nested class, like all other members of a class, have access
to private and protected members. That's what the standard says. 
 
W. 

-- 
   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


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

--- You are receiving this mail because: --- You reported the bug,
or are watching the reporter.



-- 


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


[Bug c++/21901] Nested class has access to Nestee's private member functions

2005-06-04 Thread mhcox at bluezoosoftware dot com

--- Additional Comments From mhcox at bluezoosoftware dot com  2005-06-04 
17:20 ---
>From my copy of the C++ standard (ISO/IEC 14882:1998(E)) [class.access.net] 
11.8.1:

The members of a nested class have no special access to members of an 
enclosing class, nor to classes or
functions that have granted friendship to an enclosing class; the 
usual access rules (clause 11) shall be
Obeyed.  The members of an enclosing class have no special access to 
members of a nested class; the usual
Access rules (clause 11) shall be obeyed.


-- 


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