aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/cxx0x-initializer-array.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-02-02 02:14:45 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-02-02 02:14:45 +0000
commit3fa3feab35096b608f1d79bb541798b37a55e7b9 (patch)
tree9d1266173a5b7da78cf0998856044dea5c9b1e30 /test/CodeGenCXX/cxx0x-initializer-array.cpp
parent821b93eec8b58a3e320ef34e7c98906ab61cf8c3 (diff)
PR15132: Replace "address expression must be an lvalue or a function
designator" diagnostic with more correct and more human-friendly "cannot take address of rvalue of type 'T'". For the case of & &T::f, provide a custom diagnostic, rather than unhelpfully saying "cannot take address of rvalue of type '<overloaded function type>'". For the case of &array_temporary, treat it just like a class temporary (including allowing it as an extension); the existing diagnostic wording for the class temporary case works fine. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174262 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/cxx0x-initializer-array.cpp')
-rw-r--r--test/CodeGenCXX/cxx0x-initializer-array.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/test/CodeGenCXX/cxx0x-initializer-array.cpp b/test/CodeGenCXX/cxx0x-initializer-array.cpp
index 73bbca13b1..3144e941ef 100644
--- a/test/CodeGenCXX/cxx0x-initializer-array.cpp
+++ b/test/CodeGenCXX/cxx0x-initializer-array.cpp
@@ -53,6 +53,7 @@ namespace array_dtor {
struct S { S(); ~S(); };
using T = S[3];
void f(const T &);
+ void f(T *);
// CHECK: define void @_ZN10array_dtor1gEv(
void g() {
// CHECK: %[[ARRAY:.*]] = alloca [3 x
@@ -68,10 +69,9 @@ namespace array_dtor {
// Destruct loop.
// CHECK: call void @_ZN10array_dtor1SD1Ev(
// CHECK: br i1
+ f(T{});
// CHECK: ret void
-
- f(T{});
}
// CHECK: define void @_ZN10array_dtor1hEv(
void h() {
@@ -91,4 +91,21 @@ namespace array_dtor {
// CHECK: ret void
}
+ // CHECK: define void @_ZN10array_dtor1iEv(
+ void i() {
+ // CHECK: %[[ARRAY:.*]] = alloca [3 x
+ // CHECK: br
+
+ // CHECK: call void @_ZN10array_dtor1SC1Ev(
+ // CHECK: br i1
+
+ // CHECK: call void @_ZN10array_dtor1fEPA3_NS_1SE(
+ // CHECK: br
+
+ // CHECK: call void @_ZN10array_dtor1SD1Ev(
+ // CHECK: br i1
+ f(&T{});
+
+ // CHECK: ret void
+ }
}