summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/temp_arg_nontype.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/SemaTemplate/temp_arg_nontype.cpp
parent821b93eec8b58a3e320ef34e7c98906ab61cf8c3 (diff)
downloadclang-3fa3feab35096b608f1d79bb541798b37a55e7b9.tar.gz
clang-3fa3feab35096b608f1d79bb541798b37a55e7b9.tar.bz2
clang-3fa3feab35096b608f1d79bb541798b37a55e7b9.tar.xz
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/SemaTemplate/temp_arg_nontype.cpp')
-rw-r--r--test/SemaTemplate/temp_arg_nontype.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/SemaTemplate/temp_arg_nontype.cpp b/test/SemaTemplate/temp_arg_nontype.cpp
index 59da9c667e..434054ecbd 100644
--- a/test/SemaTemplate/temp_arg_nontype.cpp
+++ b/test/SemaTemplate/temp_arg_nontype.cpp
@@ -328,7 +328,7 @@ namespace rdar13000548 {
template<typename R, R F(int)>
struct X {
typedef R (*fptype)(int);
- static fptype f() { return &F; } // expected-error{{address expression must be an lvalue or a function designator}}
+ static fptype f() { return &F; } // expected-error{{cannot take the address of an rvalue of type 'int (*)(int)'}}
};
int g(int);