[Bug 1643538] Re: gcc 5 copy list initialization creates undefined reference

sobczyk 1643538 at bugs.launchpad.net
Mon Nov 21 12:52:08 UTC 2016


** Attachment added: "test code"
   https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1643538/+attachment/4780984/+files/test.cpp

** Description changed:

- 
  g++ > 5.1
  introduced a regression
  
- Following code compiled with g++ -std=c++11
+ Attached code compiled with g++ -std=c++11 test.cpp
  
- #include <memory>
- 
- struct HelperArgs
- {
- 	std::shared_ptr<bool> dummy;
- };
- 
- static void freefunc(HelperArgs aa = {}) { };			// doesn't work
- //static void freefunc(HelperArgs aa = HelperArgs{}) { };	// works
- 
- int main()
- {
- 	freefunc();
- 	return 0;
- }
  
  creates:
- g++ -std=c++11 test.cpp
  /tmp/ccDj6FO4.o: In function `main':
  test.cpp:(.text+0xc7): undefined reference to `std::shared_ptr<bool>::shared_ptr()'
  collect2: error: ld returned 1 exit status
  
- all clang++ compile this code fine
+ all clang++ compilers compile this code fine

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-5 in Ubuntu.
https://bugs.launchpad.net/bugs/1643538

Title:
  gcc 5 copy list initialization creates undefined reference

Status in gcc-5 package in Ubuntu:
  New

Bug description:
  g++ > 5.1
  introduced a regression

  Attached code compiled with g++ -std=c++11 test.cpp

  
  creates:
  /tmp/ccDj6FO4.o: In function `main':
  test.cpp:(.text+0xc7): undefined reference to `std::shared_ptr<bool>::shared_ptr()'
  collect2: error: ld returned 1 exit status

  all clang++ compilers compile this code fine

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1643538/+subscriptions



More information about the foundations-bugs mailing list