[Bug c/41962] New: gcc fails to compile with "-combine -no-integrated-cpp"
$ gcc -v -combine -no-integrated-cpp dummy.c Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.1-4ubuntu8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8) COLLECT_GCC_OPTIONS='-v' '-combine' '-no-integrated-cpp' '-mtune=generic' /usr/lib/gcc/x86_64-linux-gnu/4.4.1/cc1 -E -quiet -v dummy.c -D_FORTIFY_SOURCE=2 -mtune=generic -fstack-protector -o /tmp/ccR6FGNf.i -o /tmp/ccCDd5ql.s cc1: error: output filename specified twice ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.4.1/../../../../x86_64-linux-gnu/include" ignoring nonexistent directory "/usr/include/x86_64-linux-gnu" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/lib/gcc/x86_64-linux-gnu/4.4.1/include /usr/lib/gcc/x86_64-linux-gnu/4.4.1/include-fixed /usr/include End of search list. -- Summary: gcc fails to compile with "-combine -no-integrated-cpp" Product: gcc Version: unknown Status: UNCONFIRMED Severity: trivial Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: miklcct at gmail dot com GCC host triplet: x86_64-linux-gnu GCC target triplet: x86_64-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41962
[Bug c++/42043] New: object destroyed at wrong time
example code: #include using namespace std; struct test { test () { cout << "test::test()" << endl; } ~test() { cout << "test::~test()" << endl; } }; struct a { const test &x; a () : x(test()){ cout << "a::a()" << endl; } ~a() { cout << "a::~a()" << endl; } }; int main() { a obj; } Expected result: test::test() a::a() test::~test() a::~a() Actual result: test::test() test::~test() a::a() a::~a() Std sect 12.2 Temporary objects 3 (...) Temporary objects are destroyed as the last step in evaluating the full-expression that (lexically) contains the point where they were created. (...) 4 There are two contexts in which temporaries are destroyed at a different point than the end of the full-expression. (...) 5 The second context is when a reference is bound to a temporary. The temporary to which the reference is bound or the temporary that is the complete object of a subobject to which the reference is bound persists for the lifetime of the reference expect: - A temporary bound to a reference member in a constructor's ctor-initializer persists until the constructor exits. -- Summary: object destroyed at wrong time Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: miklcct at gmail dot com GCC target triplet: x86_64-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42043
[Bug c++/78850] Parameter of returned generic lambda allegedly shadows parameter of free function
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78850 Michael Tsang changed: What|Removed |Added CC||miklcct at gmail dot com --- Comment #1 from Michael Tsang --- I think the following is related to this, where the parameter of a returned lambda is mis-interpreted as shadowing a local variable: [michael@samsung-rv510 ~]$ cat fix.cpp #include using std::cin; using std::cout; struct Factorial { template unsigned long operator()(Function self, unsigned long n) const { return n ? n * self(self, n - 1) : 1; } }; template auto y(Function f) { return [f](auto n) { return f(f, n); }; } int main() { unsigned long n; cin >> n; cout << y(Factorial())(n) << '\n'; return 0; } [michael@samsung-rv510 ~]$ g++ -Wshadow -std=c++14 fix.cpp -o fix fix.cpp: In instantiation of 'y(Function):: [with auto:1 = long unsigned int; Function = Factorial]': fix.cpp:21:29: required from here fix.cpp:13:22: warning: declaration of 'n' shadows a previous local [-Wshadow] return [f](auto n) { ^ fix.cpp:19:19: note: shadowed declaration is here unsigned long n; ^
[Bug c++/43253] New: g++ chokes on pseudo destructor call
mich...@ubuntu:~/src/misc$ cat test.cpp #include int main() { int *x = new int(); x->~int(); exit(0); } mich...@ubuntu:~/src/misc$ g++ test.cpp -o test test.cpp: In function int main(): test.cpp:4: error: expected class-name before int test.cpp:4: error: expected ; before int -- Summary: g++ chokes on pseudo destructor call Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: miklcct at gmail dot com GCC host triplet: x86_64-linux-gnu GCC target triplet: x86_64-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43253