diff options
author | Charles Davis <cdavis@mines.edu> | 2012-06-23 00:27:49 +0000 |
---|---|---|
committer | Charles Davis <cdavis@mines.edu> | 2012-06-23 00:27:49 +0000 |
commit | 3facb626608c99f497cb5b8bfc60d3ed3ba304b6 (patch) | |
tree | f0065a064934810f82b799965203124ff6697b9d /lib/AST/MicrosoftMangle.cpp | |
parent | 9f728cd37476c6588b06d241fa778d2df6e277da (diff) |
MicrosoftMangle: Fix mangling of integral constant non-type template arguments in a class specialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159056 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/MicrosoftMangle.cpp')
-rw-r--r-- | lib/AST/MicrosoftMangle.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp index 29319ff417..d2be5e5393 100644 --- a/lib/AST/MicrosoftMangle.cpp +++ b/lib/AST/MicrosoftMangle.cpp @@ -744,7 +744,16 @@ MicrosoftCXXNameMangler::mangleTemplateArgs( case TemplateArgument::Integral: mangleIntegerLiteral(TA.getIntegralType(), TA.getAsIntegral()); break; - default: { + case TemplateArgument::Expression: { + // See if this is a constant expression. + Expr *TAE = TA.getAsExpr(); + llvm::APSInt Value; + if (TAE->isIntegerConstantExpr(Value, Context.getASTContext())) { + mangleIntegerLiteral(TAE->getType(), Value); + break; + } + /* fallthrough */ + } default: { // Issue a diagnostic. DiagnosticsEngine &Diags = Context.getDiags(); unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error, |