From 53992adde3eda3ccf9da63bc7e45673f043de18f Mon Sep 17 00:00:00 2001 From: rdivacky Date: Thu, 27 May 2010 15:17:06 +0000 Subject: Update clang to r104832. --- test/SemaCXX/flexible-array-test.cpp | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 test/SemaCXX/flexible-array-test.cpp (limited to 'test/SemaCXX/flexible-array-test.cpp') diff --git a/test/SemaCXX/flexible-array-test.cpp b/test/SemaCXX/flexible-array-test.cpp new file mode 100644 index 0000000..02e3f83 --- /dev/null +++ b/test/SemaCXX/flexible-array-test.cpp @@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// pr7029 + +template struct QMap +{ + void insert(const Key &, const T &); + T v; +}; + + +template +void QMap::insert(const Key &, const T &avalue) +{ + v = avalue; +} + + +struct inotify_event +{ + int wd; + + // clang doesn't like '[]': + // cannot initialize a parameter of type 'void *' with an rvalue of type 'char (*)[]' + char name []; +}; + + +void foo() +{ + inotify_event event; + inotify_event* ptr = &event; + inotify_event event1 = *ptr; + *ptr = event; + QMap eventForId; + eventForId.insert(ptr->wd, *ptr); +} + +struct S { + virtual void foo(); +}; + +struct X { + int blah; + S strings[]; // expected-error {{flexible array member 'strings' of non-POD element type 'S []'}} +}; -- cgit v1.1