https://llvm.org/bugs/show_bug.cgi?id=31732
Bug ID: 31732 Summary: Clang does not warn when it deletes a function when C99 designated initializers is of non-original order Product: clang Version: 3.9 Hardware: All OS: All Status: NEW Severity: normal Priority: P Component: -New Bugs Assignee: unassignedclangb...@nondot.org Reporter: vla...@yandex-team.ru CC: llvm-bugs@lists.llvm.org Classification: Unclassified How to reproduce: ``` #include <iostream> struct Acc { int a; }; struct Buu { int b; }; struct Foo { const Acc& acc; Buu& buu; }; void printInfo( const Foo& ) { std::cout << "hi!" << std::endl; } void call( Buu& buu ) { Acc acc = { 1 }; Foo foo = { .acc = acc, .buu = buu, }; std::cout << "before" << std::endl; printInfo( foo ); std::cout << "after" << std::endl; } void noCall( Buu& buu ) { Acc acc = { 1 }; Foo foo = { .buu = buu, .acc = acc, }; std::cout << "before" << std::endl; printInfo( foo ); std::cout << "after" << std::endl; } int main() { Buu buu = { 2 }; call( buu ); noCall( buu ); return 0; } ``` Repeats at least in 3.7.0 through 3.9.0. Output: ``` before hi! after before after ``` Yes, it is not a C++ standard code, but Clang does not issue a compile error when deleting the function call. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs