[Bug c++/70551] member function of template instantiated even though only declaration is needed

2021-08-13 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70551

--- Comment #4 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #3)
> Hmm, on the trunk C++11 and C++14 still do the instantiation but C++17 and
> C++20 do not.  Was there a change in the C++ standard around this area,
> maybe a defect report?

Note clang has the same behavior as GCC does with respect to the C++ standard
versions too.

[Bug c++/70551] member function of template instantiated even though only declaration is needed

2021-08-13 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70551

--- Comment #3 from Andrew Pinski  ---
Hmm, on the trunk C++11 and C++14 still do the instantiation but C++17 and
C++20 do not.  Was there a change in the C++ standard around this area, maybe a
defect report?

[Bug c++/70551] member function of template instantiated even though only declaration is needed

2016-04-05 Thread rbock at eudoxos dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70551

--- Comment #2 from Roland B  ---
(In reply to Jonathan Wakely from comment #1)
> Your interpretation would mean that whether a compiler performs copy elision
> would change whether a program is well-formed or not (rather than only
> changing whether any side effects of the constructor call happen). That is
> not a reasonable interpretation IMHO.

I see your point, but when I remove the definition from the code, it compiles
just fine, because the definition is irrelevant in case of copy elision.

So I could have the move constructor's declaration in file A and the definition
in file B. If the definition is irrelevant, why would it matter whether or not
I include the file B containing the definition?

[Bug c++/70551] member function of template instantiated even though only declaration is needed

2016-04-05 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70551

--- Comment #1 from Jonathan Wakely  ---
Your interpretation would mean that whether a compiler performs copy elision
would change whether a program is well-formed or not (rather than only changing
whether any side effects of the constructor call happen). That is not a
reasonable interpretation IMHO.