https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110150
Andrew Pinski changed:
What|Removed |Added
Keywords||compile-time-hog
--- Comment #1 from Andrew Pinski ---
I am not shocked because even this takes some time (not as much as the original
one):
```
template
struct optional
{
T a;
optional();
template
optional(const optional&);
};
template
void f(T x)
{
f(optional(x));
}
int main()
{
// using std::optional;
optional x;
f(x);
return 0;
}
```
There is an enable if on the optional constructor in the std::optional case
which makes the time increase even more.
I doubt there is much to be optimized here except maybe lowering the template
depth limit (from the current 900, that is -ftemplate-depth=900 is the
default).