aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/copy-initialization.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-19 00:52:42 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-19 00:52:42 +0000
commit611a8c49c6a5848aed17eced8f2f3f7b1b7577a1 (patch)
tree3566b35cd469b03c6e196f59e44f8388cc9bb7b7 /test/SemaCXX/copy-initialization.cpp
parentc1debf333186f1307cd7d086c3db3e39d7da0a12 (diff)
Provide a proper source location when building an implicit dereference. Fixes PR3600
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/copy-initialization.cpp')
-rw-r--r--test/SemaCXX/copy-initialization.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/SemaCXX/copy-initialization.cpp b/test/SemaCXX/copy-initialization.cpp
index e380cc1ad3..a56a886f55 100644
--- a/test/SemaCXX/copy-initialization.cpp
+++ b/test/SemaCXX/copy-initialization.cpp
@@ -1,5 +1,4 @@
// RUN: clang -fsyntax-only -verify %s
-
class X {
public:
explicit X(const X&);
@@ -15,3 +14,10 @@ void f(Y y, int *ip, float *fp) {
X x3 = ip;
X x4 = fp; // expected-error{{cannot initialize 'x4' with an lvalue of type 'float *'}}
}
+
+struct foo {
+ void bar();
+};
+
+// PR3600
+void test(const foo *P) { P->bar(); } // expected-error{{cannot initialize object parameter of type 'struct foo' with an expression of type 'struct foo const'}}