summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/const-init-cxx11.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-08-07 04:16:51 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-08-07 04:16:51 +0000
commit8ae4ec28451a16a57718286da3e476fc2f495c3f (patch)
tree27a7eeb26c7d5f432b76bedd2c9cf7dbb57db5b4 /test/CodeGenCXX/const-init-cxx11.cpp
parentdaa88985ed6d174aeb8c6ddca394f734a73268b7 (diff)
Teach Expr::HasSideEffects about all the Expr types, and fix a bug where it
was mistakenly classifying dynamic_casts which might throw as having no side effects. Switch it from a visitor to a switch, so it is kept up-to-date as future Expr nodes are added. Move it from ExprConstant.cpp to Expr.cpp, since it's not really related to constant expression evaluation. Since we use HasSideEffect to determine whether to emit an unused global with internal linkage, this has the effect of suppressing emission of globals in some cases. I've left many of the Objective-C cases conservatively assuming that the expression has side-effects. I'll leave it to someone with better knowledge of Objective-C than mine to improve them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161388 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/const-init-cxx11.cpp')
-rw-r--r--test/CodeGenCXX/const-init-cxx11.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/CodeGenCXX/const-init-cxx11.cpp b/test/CodeGenCXX/const-init-cxx11.cpp
index d2504d78cd..db1bb41260 100644
--- a/test/CodeGenCXX/const-init-cxx11.cpp
+++ b/test/CodeGenCXX/const-init-cxx11.cpp
@@ -326,8 +326,8 @@ namespace PR13273 {
S() = default;
};
- // CHECK: @_ZN7PR13273L1sE = {{.*}} zeroinitializer
- const S s {};
+ // CHECK: @_ZN7PR132731sE = {{.*}} zeroinitializer
+ extern const S s {};
}
// Constant initialization tests go before this point,