diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-17 23:29:39 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-17 23:29:39 +0000 |
commit | 9fcc5c31c46d1683a7376292262c06fd0d8514f4 (patch) | |
tree | 6256b2e2a12d56bd4997fc91dfd3f12d965cc1a8 /clang/test/SemaCXX/offsetof.cpp | |
parent | 479a8fe75ed32ec399c7c492002de961011b3a92 (diff) | |
download | bcm5719-llvm-9fcc5c31c46d1683a7376292262c06fd0d8514f4.tar.gz bcm5719-llvm-9fcc5c31c46d1683a7376292262c06fd0d8514f4.zip |
Perform lvalue-to-rvalue conversions on __builtin_offsetof array argument index
before typechecking, as suggested by John.
llvm-svn: 142308
Diffstat (limited to 'clang/test/SemaCXX/offsetof.cpp')
-rw-r--r-- | clang/test/SemaCXX/offsetof.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/offsetof.cpp b/clang/test/SemaCXX/offsetof.cpp index 17cee62d16f..a5f5d347c28 100644 --- a/clang/test/SemaCXX/offsetof.cpp +++ b/clang/test/SemaCXX/offsetof.cpp @@ -66,3 +66,10 @@ struct bar : public foo { }; int anonstruct[__builtin_offsetof(bar, x) == 0 ? 1 : -1]; + +struct LtoRCheck { + int a[10]; + int f(); +}; +int ltor = __builtin_offsetof(struct LtoRCheck, a[LtoRCheck().f]); // \ + expected-error {{reference to non-static member function must be called}} |