constexpr const char kEta[] = "Eta";
template <const char*, typename T> class Column {};
using quick = Column<kEta,double>;
void lookup() {
   quick c1;
   c1.ls();
}emits error: no member named 'ls' in 'Column<&kEta, double>' Attached patch fixes the printed type name by not printing the ampersand for array types.
It passes check-clang for me.
If this change is acceptable: where do you want a test to go?
Hmm. This seems unnecessarily complex. Oh, and I think I suggested the comparison wrong for pointer depth.
Is there a case where the following doesn't work?
static unsigned getArrayDepth(QualType type) { unsigned count = 0; while (const auto *arrayType = type->getAsArrayTypeUnsafe()) { count++; type = arrayType->getElementType(); } return count; } static bool needsAmpersandOnTemplateArg(QualType paramType, QualType argType, ASTContext &Ctx) { if (!paramType->isPointerType()) return false; if (argType->isFunctionType()) return true; if (argType->isArrayType()) return getArrayDepth(argType) < getArrayDepth(paramType->getPointeeType()); return false; }