Fix the type of a enum non-type template argument within the instantiation.

llvm-svn: 72489
This commit is contained in:
Sebastian Redl 2009-05-27 19:21:29 +00:00
parent 4db1631a43
commit eed3d4c73e
2 changed files with 8 additions and 1 deletions

View File

@ -1494,7 +1494,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
}
Converted->push_back(TemplateArgument(StartLoc, Value,
Context.getCanonicalType(IntegerType)));
ParamType->isEnumeralType() ? ParamType : IntegerType));
}
return false;

View File

@ -0,0 +1,7 @@
// RUN: clang-cc -fsyntax-only -verify %s
enum Enum { val = 1 };
template <Enum v> struct C {
typedef C<v> Self;
};
template struct C<val>;