++
Assignee: unassigned at gcc dot gnu.org
Reporter: lisp2d at lisp2d dot net
Declaring reference of result of functions MIN or MAX we get a DEAD memory when
one of arguments is an RValue.
// gcc -std=c++11 -Os bug.cpp
// gcc -std=c++11 -O2 bug.cpp
#includeiostream
void f(size_t const x
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61528
--- Comment #2 from Lisp2D lisp2d at lisp2d dot net ---
Issue a warning would not hurt.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61528
--- Comment #4 from Lisp2D lisp2d at lisp2d dot net ---
Likely error in the standard. The right set of functions must return a copy of
the data and return a the temporary link with real data.
Working version of it:
size_t const min2(size_t
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55166
Bug #: 55166
Summary: c++11: std::string and =std:move makes swapping
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: normal
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55098
Bug #: 55098
Summary: c++11: move constructor doesn't run at all (but with a
hammer)
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55098
--- Comment #1 from Lisp2D lisp2d at lisp2d dot net 2012-10-27 15:01:42 UTC
---
May be it is optimisation, but without instruction and with side effects.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55098
Lisp2D lisp2d at lisp2d dot net changed:
What|Removed |Added
Status|RESOLVED|UNCONFIRMED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55098
--- Comment #4 from Lisp2D lisp2d at lisp2d dot net 2012-10-27 15:24:06 UTC
---
(In reply to comment #3)
My opinion is to enable elide-constructors in -sdt=c++11.
Programers in this standard use own move-constructors with own-side
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55098
--- Comment #5 from Lisp2D lisp2d at lisp2d dot net 2012-10-27 15:46:39 UTC
---
OK. Right path is: DON'T return anything.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55082
Bug #: 55082
Summary: c++11: default member constructor
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: normal
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55038
Bug #: 55038
Summary: c++11: operator +=
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483
--- Comment #18 from Lisp2D lisp2d at lisp2d dot net 2012-02-09 16:59:19 UTC
---
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483#c2
shows that function calling of object before constructor is bad idea and must
be strongly forbidden.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483
--- Comment #10 from Lisp2D lisp2d at lisp2d dot net 2011-04-07 13:19:16 UTC
---
(In reply to comment #9)
No, the variable is in scope after its identifier, so it can be used in the
initializer expression, e.g.
int i = sizeof(i); // ok
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483
--- Comment #15 from Lisp2D lisp2d at lisp2d dot net 2011-04-07 13:58:38 UTC
---
(In reply to comment #12)
For the example in comment 2 G++, EDG and Clang++ all accept it without
warning.
MSVC rejects it, but is wrong to do so.
The answer
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483
Summary: Construct from yourself w/o warning
Product: gcc
Version: 4.5.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483
--- Comment #2 from Lisp2D lisp2d at lisp2d dot net 2011-04-06 21:15:42 UTC
---
Try the next example, more close to my code:
#includeiostream
classA{
public:
inta;
A(intx):a(x){}
intTheInt(){returna;}
};
void
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483
--- Comment #7 from Lisp2D lisp2d at lisp2d dot net 2011-04-07 04:33:52 UTC
---
The example
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483#c2
shows a compiler bug.
TYPE VARIABLE [ARGUMENT-TO-CONSTRUCT]
The compiler must doing like this:
1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48418
Summary: Bit shift operator =
Product: gcc
Version: 4.5.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassig...@gcc.gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48255
Summary: default constructor with argument INT
Product: gcc
Version: 4.5.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48255
--- Comment #2 from Lisp2D lisp2d at lisp2d dot net 2011-03-23 16:15:14 UTC
---
found silent conversion
class A have
explicit A(std::complexlong doubleconst x);
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48185
Summary: if(struct ...)
Product: gcc
Version: 4.5.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassig...@gcc.gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48185
--- Comment #2 from Lisp2D lisp2d at lisp2d dot net 2011-03-18 17:15:23 UTC
---
Code
{ struct passwd*pwd(getpwuid(...));
if(pwd)return true;}
is still compiled.
Code
if(struct passwd*pwd=getpwuid(...))return;
compiled too.
But
if(struct
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46929
Summary: Xutil.h and Complex - some trouble
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo:
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: lisp2d at lisp2d dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39463
--- Comment #2 from lisp2d at lisp2d dot net 2009-01-24 06:00 ---
The niche is selected incorrectly. Basically the considerable quantity of
errors of programming is linked to implicit type conversion.
void insert(char*,char,unsigned int){..}
insert(..,..,size_t);
Example
double d
--- Comment #7 from lisp2d at lisp2d dot net 2009-01-03 17:19 ---
The type long double does not have uniform standard.
Confusion has turned out.
Accuracy of type double suits me.
Let's complete this talk.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38704
.
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: lisp2d at lisp2d dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id
--- Comment #2 from lisp2d at lisp2d dot net 2009-01-02 19:37 ---
Quantity of correct bits is 64, the size of long double is 128 bits.
Half of quality is reached by usage of operations multiplication, divisions.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38704
--- Comment #4 from lisp2d at lisp2d dot net 2009-01-03 00:12 ---
__LDBL_DIG__=18
__DBL_DIG__=15
sizeof(long double)=128 bits
sizeof(double)=64 bits
It is named the legalised crime.
If the program is written incorrectly no law will correct it.
--
http://gcc.gnu.org/bugzilla
--- Comment #5 from lisp2d at lisp2d dot net 2008-12-25 14:36 ---
Let's start from the beginning.
class A{public:intx;A():x(0){};};
class B:publicA{public:inty;B():A(),y(0){};};
class C:publicA{public:intz;C():A(),z(0){};};
B xb;
C xc
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: lisp2d at lisp2d dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38622
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: lisp2d at lisp2d dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38623
--- Comment #4 from lisp2d at lisp2d dot net 2008-12-25 05:41 ---
If commands if and ?: operate on a miscellaneous.
Not clearly when works copyconstructor and when there is no.
class A{public:intx;A():x(0){};};
class B:publicA{public:inty;B():A(),y(0){};};
class
--- Comment #3 from lisp2d at lisp2d dot net 2008-12-16 05:52 ---
More exact example:
.h:
extern int i;
.cpp:
int i; // ok
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38517
: unassigned at gcc dot gnu dot org
ReportedBy: lisp2d at lisp2d dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38517
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: lisp2d at lisp2d dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38055
36 matches
Mail list logo