[Bug c++/52818] New: printf format %lf is erroneously rejected by C++11

2012-04-01 Thread joedoefawnbuck at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52818

 Bug #: 52818
   Summary: printf format %lf is erroneously rejected by C++11
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: trivial
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: joedoefawnb...@googlemail.com


C99, and thus C++11, allow %lf as a synonym for %f as a printf format
specifier. However, with `-pedantic -Wformat -std=c++11`, GCC 4.7. emits a
warning:

#include 
int main() { return std::printf("%lf", 0.0); }

warning: ISO C++ does not support the ‘%lf’ gnu_printf format [-Wformat]

The same holds for -std=c99 and -std=c11.


[Bug c++/52818] printf format %lf is erroneously rejected by C++11

2012-04-01 Thread joedoefawnbuck at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52818

--- Comment #1 from Kerrek SB  2012-04-01 
12:09:34 UTC ---
Correction: The warnings do NOT appear (correctly so) for C99 and C11.


[Bug c++/55635] New: Deallocation function ("operator delete") not called when destructor throws exception

2012-12-09 Thread joedoefawnbuck at googlemail dot com


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



 Bug #: 55635

   Summary: Deallocation function ("operator delete") not called

when destructor throws exception

Classification: Unclassified

   Product: gcc

   Version: 4.7.2

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: c++

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: joedoefawnb...@googlemail.com





According to C++11, 5.3.5/7, the deallocation function of a dynamically

allocated object must be called upon a `delete` expression regardless of

whether the destructor exits with an exception or not.



However, when I run the following code through valgrind, it says that I have

one still-reachable block:



struct Foo { ~Foo() { throw 0; } };



int main()

{

auto p = new Foo;

try { delete p; }

catch (...) { }

}



Am I reading the standard right that the memory should be deallocated

regardless?



(SO discussion: http://stackoverflow.com/q/13792981/596781)


[Bug c++/55635] Deallocation function ("operator delete") not called when destructor throws exception

2012-12-10 Thread joedoefawnbuck at googlemail dot com


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



--- Comment #2 from Kerrek SB  2012-12-10 
09:08:46 UTC ---

Interesting, thank you!



The bug remains, however, both with -std=c++11 and noexcept(false), and with

-std=c++98 and throw(int).



Also, with noexcept(false) GCC will *not* call terminate()...


[Bug c++/55635] Deallocation function ("operator delete") not called when destructor throws exception

2012-12-10 Thread joedoefawnbuck at googlemail dot com


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



--- Comment #3 from Kerrek SB  2012-12-10 
09:10:25 UTC ---

(Sorry, I meant "*without* noexcept(false)".)