You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# simple example# my compiler g++(clang++) reports `int` and `const int*` which are deduced types of `x` and `y`
$ g++ -std=c++14 compiler_diagnostics.cc
compiler_diagnostics.cc:17:21: error: implicit instantiation of undefined template 'TD<int>'
TD<decltype(x)> x1;
^
compiler_diagnostics.cc:7:7: note: template is declared here
class TD;
^
compiler_diagnostics.cc:18:21: error: implicit instantiation of undefined template 'TD<const int *>'
TD<decltype(y)> y1;
^
compiler_diagnostics.cc:7:7: note: template is declared here
class TD;
^
2 errors generated.
# complex example# my compile g++(clang++) reports `const Widget* const&` for `ParamType` and `const Widget*` for `T`
$ g++ -std=c++14 -DCOMPILER_DIAGNOSTICS complex_sample.cc
In file included from complex_sample.cc:2:
./complex_sample.hpp:12:25: error: implicit instantiation of undefined template 'TD<const Widget *const &>'
TD<decltype(param)> t;
^
complex_sample.cc:20:9: note: in instantiation of functiontemplate specialization 'f<const Widget *>' requested here
f(&vw[0]);
^
./compiler_diagnostics.hpp:6:7: note: template is declared here
class TD;
^
1 error generated.