aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/destructors.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-05-01 06:05:57 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-05-01 06:05:57 +0000
commit5729672524865f212cbadb51170dca0694e79a71 (patch)
tree452174f57708cf48c0633e5d5a507bbd492e1880 /test/CodeGenCXX/destructors.cpp
parent08c88db935adf005e42c1f513242eec960644b63 (diff)
PR12710 - broken default argument handling for templates.
I broke this in r155838 by not actually instantiating non-dependent default arg expressions. The motivation for that change was to avoid producing duplicate conversion warnings for such default args (we produce them once when we parse the template - there's no need to produce them at each instantiation) but without actually instantiating the default arg, things break in weird ways. Technically, I think we could still get the right diagnostic experience without the bugs if we instantiated the non-dependent args (for non-dependent params only) immediately, rather than lazily. But I'm not sure if such a refactoring/ change would be desirable so here's the conservative fix for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155893 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/destructors.cpp')
-rw-r--r--test/CodeGenCXX/destructors.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGenCXX/destructors.cpp b/test/CodeGenCXX/destructors.cpp
index d9962e615e..b8ec2761be 100644
--- a/test/CodeGenCXX/destructors.cpp
+++ b/test/CodeGenCXX/destructors.cpp
@@ -350,6 +350,22 @@ namespace test8 {
// CHECK: unreachable
}
+// PR12710
+namespace test9 {
+ struct ArgType {
+ ~ArgType();
+ };
+ template<typename T>
+ void f1(const ArgType& = ArgType());
+ void f2();
+ void bar() {
+ f1<int>();
+ f2();
+ }
+ // CHECK: call void @_ZN5test97ArgTypeD1Ev(%"struct.test9::ArgType"* %ref.tmp)
+ // CHECK: call void @_ZN5test92f2Ev()
+}
+
// Checks from test3:
// CHECK: define internal void @_ZN5test312_GLOBAL__N_11DD0Ev(%"struct.test3::<anonymous namespace>::D"* %this) unnamed_addr