summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2013-10-20 18:48:56 +0000
committerAlp Toker <alp@nuanti.com>2013-10-20 18:48:56 +0000
commit67b47ac0a76bdfa68d2191d7b78d253b0e084a8c (patch)
tree5edb0d3346927c8263f9ee38b712531808ce4232 /clang/test
parentd46e07e26e5256327eb38b092057b58547310b18 (diff)
downloadbcm5719-llvm-67b47ac0a76bdfa68d2191d7b78d253b0e084a8c.tar.gz
bcm5719-llvm-67b47ac0a76bdfa68d2191d7b78d253b0e084a8c.zip
Fix crash in cleanup attr handling
ResolveSingleFunctionTemplateSpecialization() returns 0 and doesn't emit diags unless the expression has template-ids, so we must null check the result. Also add a better diag noting which overloads are causing the problem. Reviewed by Aaron Ballman. llvm-svn: 193055
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/attr-cleanup.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/attr-cleanup.cpp b/clang/test/SemaCXX/attr-cleanup.cpp
index b6c58533acf..764df997dec 100644
--- a/clang/test/SemaCXX/attr-cleanup.cpp
+++ b/clang/test/SemaCXX/attr-cleanup.cpp
@@ -19,3 +19,11 @@ class D : public C {
int v1 __attribute__((cleanup(c2))); // expected-error {{'c2' is a private member of 'C'}}
}
};
+
+namespace E {
+ void c3(int *a) {} // expected-note {{candidate function}}
+ void c3() {} // expected-note {{candidate function}}
+ void t3() {
+ int v1 __attribute__((cleanup(c3))); // expected-error {{'c3' is not a single function}}
+ }
+}
OpenPOWER on IntegriCloud