diff options
author | Roger Ferrer Ibanez <roger.ferreribanez@arm.com> | 2017-04-19 12:23:28 +0000 |
---|---|---|
committer | Roger Ferrer Ibanez <roger.ferreribanez@arm.com> | 2017-04-19 12:23:28 +0000 |
commit | cb89513bc74257178e8adb09029b64ab8b52bed5 (patch) | |
tree | 8946175d1e13fb74b73d37ad8979e1cd25d490d2 /clang/test/CodeGenCXX/unaligned-duplicated-mangle-name.cpp | |
parent | f3f923c9d22268f6ea468ebd3703b052b6dac16d (diff) | |
download | bcm5719-llvm-cb89513bc74257178e8adb09029b64ab8b52bed5.tar.gz bcm5719-llvm-cb89513bc74257178e8adb09029b64ab8b52bed5.zip |
Avoid assert when a non-static member function is qualified with __unaligned
Under -fms-extensions __unaligned is a type-qualifier that can be applied to a
non-static member function declaration.
This causes an assertion when mangling the name under Itanium, where that
qualifier is not mangled.
This patch justs makes the minimal change to avoid the crash and avoid mangling
__unaligned, as it currently happens with non-member functions.
Differential Revision: https://reviews.llvm.org/D31976
llvm-svn: 300686
Diffstat (limited to 'clang/test/CodeGenCXX/unaligned-duplicated-mangle-name.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/unaligned-duplicated-mangle-name.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/unaligned-duplicated-mangle-name.cpp b/clang/test/CodeGenCXX/unaligned-duplicated-mangle-name.cpp new file mode 100644 index 00000000000..a23e6a47ab0 --- /dev/null +++ b/clang/test/CodeGenCXX/unaligned-duplicated-mangle-name.cpp @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -fms-extensions -emit-llvm-only %s -verify + +struct A +{ + int x; + void foo() __unaligned; + void foo(); +}; + +void A::foo() __unaligned +{ + this->x++; +} + +void A::foo() // expected-error {{definition with same mangled name as another definition}} + // expected-note@-6 {{previous definition is here}} +{ + this->x++; +} + |