diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2010-12-15 15:06:14 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2010-12-15 15:06:14 +0000 |
commit | fb7b36327c4cd14c9454e0e9c26f8c44ba8207c0 (patch) | |
tree | d2aa96e7731797a37e416019ea79cb036d054efa /test/Coverage | |
parent | f24e54a0c8f0621dc1e964e79dd2fc47f6a2e723 (diff) |
Sema: have BuildExpressionFromIntegralTemplateArgument produce well-formed IntegerLiterals
BuildExpressionFromIntegralTemplateArgument can produce malformed
IntegerLiterals with an EnumType if the template parameter type
is an EnumType. This breaks the AST printer which expects all
IntegerLiterals to have a plain integer type. Instead, give the
IntegerLiteral the enum's promotion type and wrap in an implicit cast
to the EnumType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Coverage')
-rw-r--r-- | test/Coverage/cxx-language-features.inc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Coverage/cxx-language-features.inc b/test/Coverage/cxx-language-features.inc index 51c11046a8..31b50be335 100644 --- a/test/Coverage/cxx-language-features.inc +++ b/test/Coverage/cxx-language-features.inc @@ -19,3 +19,9 @@ class Base1 { class Base2 { }; class Derived1 : Base1, virtual public Base2 { }; + +/* Template classes, template functions */ +enum E1 { EC1 }; +template <E1 v> class C1 {}; +template <E1 v> C1<v> f1() { return C1<v>(); } +void f2() { f1<EC1>(); } |