2016-11-21 12:53:09 |
sobczyk |
description |
g++ > 5.1
introduced a regression
Following code compiled with g++ -std=c++11
#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 |
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 |
|