[PATCH] D32372: Arrays of unknown bound in constant expressions

2017-04-21 Thread Robert Haberlach via Phabricator via cfe-commits
Arcoth created this revision. Arrays of unknown bound are subject to some bugs in constant expressions. const extern int arr[]; constexpr int f(int i) {return arr[i];} constexpr int arr[] {1, 2, 3}; int main() {constexpr int x = f(2);} This is spuriously rejected. On the other hand, extern cons

[PATCH] D32372: Arrays of unknown bound in constant expressions

2017-04-25 Thread Robert Haberlach via Phabricator via cfe-commits
Arcoth updated this revision to Diff 96594. Arcoth marked 6 inline comments as done. Arcoth added a comment. Adjusted. Implemented the changes suggested by Richard. The array-to-pointer decay is now well-formed; the check was instead moved to the pointer arithmetic facility. https://reviews.l

[PATCH] D32372: Arrays of unknown bound in constant expressions

2017-04-25 Thread Robert Haberlach via Phabricator via cfe-commits
Arcoth updated this revision to Diff 96603. Arcoth added a comment. Small fix. https://reviews.llvm.org/D32372 Files: include/clang/Basic/DiagnosticASTKinds.td lib/AST/ExprConstant.cpp test/SemaCXX/constexpr-array-unknown-bound.cpp Index: test/SemaCXX/constexpr-array-unknown-bound.cpp ==

[PATCH] D32372: Arrays of unknown bound in constant expressions

2017-04-28 Thread Robert Haberlach via Phabricator via cfe-commits
Arcoth updated this revision to Diff 97105. Arcoth added a comment. Updated `SubobjectDesignator` to hold `MostDerivedIsAnUnsizedArray` instead of `FirstEntryIsAnUnsizedArray`. Consequently, we cannot know whether the first element is an unsized array; please see line 7352 in particular, where t

[PATCH] D32372: Arrays of unknown bound in constant expressions

2017-04-28 Thread Robert Haberlach via Phabricator via cfe-commits
Arcoth updated this revision to Diff 97114. Arcoth added a comment. Simplified array-to-pointer conversion (simply add the array as unsized; let findCompleteObject and the SubobjectDesignator ctor do the work). https://reviews.llvm.org/D32372 Files: include/clang/Basic/DiagnosticASTKinds.td

[PATCH] D32372: Arrays of unknown bound in constant expressions

2017-04-28 Thread Robert Haberlach via Phabricator via cfe-commits
Arcoth updated this revision to Diff 97116. Arcoth added a comment. (Just fixed a slip after typing with the wrong window in focus...) https://reviews.llvm.org/D32372 Files: include/clang/Basic/DiagnosticASTKinds.td lib/AST/ExprConstant.cpp test/SemaCXX/constexpr-array-unknown-bound.cpp

[PATCH] D32372: Arrays of unknown bound in constant expressions

2017-04-28 Thread Robert Haberlach via Phabricator via cfe-commits
Arcoth updated this revision to Diff 97180. Arcoth added a comment. Applied the last review's suggestions. https://reviews.llvm.org/D32372 Files: include/clang/Basic/DiagnosticASTKinds.td lib/AST/ExprConstant.cpp test/SemaCXX/constexpr-array-unknown-bound.cpp Index: test/SemaCXX/constexp

[PATCH] D32824: [libc++] Use placeholder return types to avoid hard errors during overload resolution

2017-05-03 Thread Robert Haberlach via Phabricator via cfe-commits
Arcoth created this revision. Herald added a reviewer: EricWF. See https://bugs.llvm.org/show_bug.cgi?id=32856. Basically, as this code was written before placeholder return types for functions were a thing, the function call operators of __bind apply decltype on the call expression to infer the

[PATCH] D32824: [libc++] Use placeholder return types to avoid hard errors during overload resolution

2017-05-03 Thread Robert Haberlach via Phabricator via cfe-commits
Arcoth added a comment. In https://reviews.llvm.org/D32824#745392, @EricWF wrote: > This change regresses other code. By changing `__bind_return<...>::type` into > `decltype(auto)` you prevent the member functions from SFINAE'ing. For > example: > > #include > > struct Func { > templ