diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-10-26 02:31:56 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-10-26 02:31:56 +0000 |
| commit | 842e46e606b13e29b4136a455ad5d77249a7f9f4 (patch) | |
| tree | 16f43c1d3d1a745f60e4648cf5bc78706aa4015b /clang/test/Modules | |
| parent | 28a1b8c8bb01408fea27700a65d212eb0137a6f0 (diff) | |
| download | bcm5719-llvm-842e46e606b13e29b4136a455ad5d77249a7f9f4.tar.gz bcm5719-llvm-842e46e606b13e29b4136a455ad5d77249a7f9f4.zip | |
[modules] Fix assert if multiple update records provide a definition for a
class template specialization and that specialization has attributes.
llvm-svn: 285160
Diffstat (limited to 'clang/test/Modules')
| -rw-r--r-- | clang/test/Modules/Inputs/templates-left.h | 2 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/templates-right.h | 2 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/templates-top.h | 5 | ||||
| -rw-r--r-- | clang/test/Modules/templates.mm | 7 |
4 files changed, 15 insertions, 1 deletions
diff --git a/clang/test/Modules/Inputs/templates-left.h b/clang/test/Modules/Inputs/templates-left.h index cbe89434f9f..4f7abeef1fa 100644 --- a/clang/test/Modules/Inputs/templates-left.h +++ b/clang/test/Modules/Inputs/templates-left.h @@ -70,3 +70,5 @@ namespace EmitDefaultedSpecialMembers { inline int *getStaticDataMemberLeft() { return WithUndefinedStaticDataMember<int[]>::undefined; } + +inline WithAttributes<int> make_with_attributes_left() { return WithAttributes<int>(); } diff --git a/clang/test/Modules/Inputs/templates-right.h b/clang/test/Modules/Inputs/templates-right.h index 32487c60c26..bb3f7c30182 100644 --- a/clang/test/Modules/Inputs/templates-right.h +++ b/clang/test/Modules/Inputs/templates-right.h @@ -51,3 +51,5 @@ void outOfLineInlineUseRightH(void (OutOfLineInline<int>::*)() = &OutOfLineInlin inline int *getStaticDataMemberRight() { return WithUndefinedStaticDataMember<int[]>::undefined; } + +inline WithAttributes<int> make_with_attributes_right() { return WithAttributes<int>(); } diff --git a/clang/test/Modules/Inputs/templates-top.h b/clang/test/Modules/Inputs/templates-top.h index a0826835239..207d705432e 100644 --- a/clang/test/Modules/Inputs/templates-top.h +++ b/clang/test/Modules/Inputs/templates-top.h @@ -58,3 +58,8 @@ namespace EmitDefaultedSpecialMembers { template<typename T> struct WithUndefinedStaticDataMember { static T undefined; }; + +template<typename T> struct __attribute__((packed, aligned(2))) WithAttributes { + T value; +}; +WithAttributes<int> *get_with_attributes(); diff --git a/clang/test/Modules/templates.mm b/clang/test/Modules/templates.mm index cd80e2480bf..79e975a1ad1 100644 --- a/clang/test/Modules/templates.mm +++ b/clang/test/Modules/templates.mm @@ -116,4 +116,9 @@ void testStaticDataMember() { (void) getStaticDataMemberRight(); } - +void testWithAttributes() { + auto a = make_with_attributes_left(); + auto b = make_with_attributes_right(); + static_assert(alignof(decltype(a)) == 2, ""); + static_assert(alignof(decltype(b)) == 2, ""); +} |

