Index: include/clang/AST/Type.h =================================================================== --- include/clang/AST/Type.h +++ include/clang/AST/Type.h @@ -4901,7 +4901,9 @@ return !isDependentType() || isCurrentInstantiation() || isTypeAlias(); } - QualType desugar() const { return getCanonicalTypeInternal(); } + QualType desugar() const { + return isTypeAlias() ? getAliasedType() : getCanonicalTypeInternal(); + } void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Ctx) { Profile(ID, Template, template_arguments(), Ctx); Index: test/SemaCXX/alignof.cpp =================================================================== --- test/SemaCXX/alignof.cpp +++ test/SemaCXX/alignof.cpp @@ -97,3 +97,8 @@ typedef __attribute__((aligned(N))) int Field[sizeof(N)]; // expected-error {{requested alignment is dependent but declaration is not dependent}} }; } + +typedef int __attribute__((aligned(16))) aligned_int; +template +using template_alias = aligned_int; +static_assert(alignof(template_alias) == 16, "Expected alignment of 16" );