Clang has switched to gnu++17 by default with https://reviews.llvm.org/D131465. C++17 removes dynamic exception specification. Remove its use as it wasn't properly tested. Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D133467
52 lines
902 B
C++
52 lines
902 B
C++
#include <stdio.h>
|
|
|
|
class ExcA {};
|
|
class ExcB {};
|
|
class ExcC {};
|
|
class ExcD {};
|
|
class ExcE {};
|
|
class ExcF {};
|
|
class ExcG {};
|
|
|
|
void foo(int a)
|
|
{
|
|
if (a > 1)
|
|
throw ExcG();
|
|
else
|
|
throw ExcC();
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
asm volatile ("nop;nop;nop;nop;nop");
|
|
try {
|
|
try {
|
|
asm volatile ("nop;nop;nop;nop;nop");
|
|
throw ExcA();
|
|
} catch (ExcA) {
|
|
asm volatile ("nop;nop;nop;nop;nop");
|
|
printf("catch 2\n");
|
|
throw new int();
|
|
}
|
|
} catch (...) {
|
|
asm volatile ("nop;nop;nop;nop;nop");
|
|
printf("catch 1\n");
|
|
}
|
|
|
|
try {
|
|
asm volatile ("nop;nop;nop;nop;nop");
|
|
try {
|
|
asm volatile ("nop;nop;nop;nop;nop");
|
|
foo(argc);
|
|
} catch (ExcC) {
|
|
asm volatile ("nop;nop;nop;nop;nop");
|
|
printf("caught ExcC\n");
|
|
}
|
|
} catch (ExcG) {
|
|
asm volatile ("nop;nop;nop;nop;nop");
|
|
printf("caught ExcG\n");
|
|
}
|
|
|
|
return 0;
|
|
}
|