Previously committed as 9e08e51a20d0d2b1c5724bb17e969d036fced4cd, and
reverted because a dependency commit was reverted, then commited again
as 4b574008aef5a7235c1f894ab065fe300d26e786 and reverted again because
"dependency commit" 5a391d38ac6c561ba908334d427f26124ed9132e was
reverted. But it doesn't seem that 5a391d38ac6c was a real dependency
for this.
This commit incorporates 4b574008aef5a7235c1f894ab065fe300d26e786 and
18e093faf726d15f210ab4917142beec51848258 by Richard Smith, with some
minor fixes, most notably:
- VK_PRValue instead of VK_RValue as default kind in lvalue and
member pointer handling branch
in BuildExpressionFromNonTypeTemplateArgumentValue;
- handling of UncommonValue in IsTypeDeclaredInsideVisitor;
- filling in SugaredConverted along with CanonicalConverted
parameter in Sema::CheckTemplateArgument;
- minor cleanup
in TemplateInstantiator::transformNonTypeTemplateParmRef;
- noundef attribute and opaque pointers in template-arguments test;
- analysis for C++17 mode is turned off for templates
in warn-bool-conversion test;
in C++17 and C++20 mode, array reference used as a template argument
of pointer type produces template argument of UncommonValue type, and
BuildExpressionFromNonTypeTemplateArgumentValue makes
OpaqueValueExpr for it, and DiagnoseAlwaysNonNullPointer cannot see
through it; despite of "These cases should not warn" comment, I'm not
sure about correct behavior; I'd expect a suggestion to replace if by
if constexpr;
- temp.arg.nontype/p1.cpp test fixed.
I definitely hate the name here... Just Value makes a bit more sense, but isn't perfectly accurate. Perhaps NonTypeValue? But that is a little redundant. Uncommon here is just strange and not particularly descriptive.