Not intend to land it now, but ready for review.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
clang/test/CXX/temp/temp.decls/temp.variadic/fixed-expansion.cpp | ||
---|---|---|
129 ↗ | (On Diff #276733) | the secondary diagnostic is technically correct, but I don't quite like it, it is confusing, ok to leave it as-is? or fix that before landing this patch? |
As you said, we can't land this before the branch cut, and we shouldn't land this until we've run internal experiments to show it's not horribly crashy.
clang/test/CXX/temp/temp.constr/temp.constr.order/function-templates.cpp | ||
---|---|---|
71 | this is really nice :-) | |
clang/test/CXX/temp/temp.decls/temp.variadic/fixed-expansion.cpp | ||
129 ↗ | (On Diff #276733) | I don't think it's technically correct (the int fallback is an implementation artifact, albeit one that leaks quite often). Fix ideas:
|
As you said, we can't land this before the branch cut, and we shouldn't land this until we've run internal experiments to show it's not horribly crashy.
The internal experiment result is good, I think we're close to land it. After a new rebase, we need to adjust more diagnostics, but all of them look like good secondary-diagnostic improvements.
clang/test/CXX/temp/temp.decls/temp.variadic/fixed-expansion.cpp | ||
---|---|---|
129 ↗ | (On Diff #276733) | Fixed in D85714. |
New diagnostics are really good :-)
clang/test/SemaCXX/abstract.cpp | ||
---|---|---|
282 | the new diagnostics are correct (nice!) but this is just a bug in the test: To keep the test simple, I'd consider changing C& to const C& here instead. | |
clang/test/SemaCXX/type-convert-construct.cpp | ||
9 | again, arr v3 = arr(); is almost certainly intended |
update a comment.
clang/test/SemaCXX/abstract.cpp | ||
---|---|---|
282 | I'd prefer to keep these as these are secondary-diagnostic improvements (so that we will not regress them in the future). I fixed these tests, and created two in recovery-ast-type.cpp. |
Hi @hokein,
sorry, but looks like your changes break one of libc++ tests on ARM cross toolchain build on Windows: libc++::function_type_default_deleter.fail.cpp
Here is the first failed build: http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l/builds/945
I didn't get how these changes affects the failing test, but reverting of your commit fixes the problem.
Would you take a look and fix the problem? or revert the changes if it is going to take a lot of time to resolve?
Here is the command line to build the test:
C:/buildbot/temp/build/./bin/clang++.exe C:/buildbot/temp/llvm-project/libcxx/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp -v --sysroot=C:/buildbot/.arm-ubuntu --target=armv7-linux-gnueabihf -include C:/buildbot/temp/build/runtimes/runtimes-bins/libcxx\__config_site -include C:/buildbot/temp/llvm-project/libcxx\test\support\nasty_macros.h -nostdinc++ -IC:/buildbot/temp/llvm-project/libcxx\include -IC:/buildbot/temp/build/runtimes/runtimes-bins/libcxx\include\c++build -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -IC:/buildbot/temp/llvm-project/libcxx\test/support -Werror -Wall -Wextra -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -std=c++2a -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fsyntax-only -Wno-error -Xclang -verify -Xclang -verify-ignore-unexpected=note -ferror-limit=0
Here is the result output:
clang -cc1 version 12.0.0 based upon LLVM 12.0.0git default target armv7-linux-gnueabihf ignoring nonexistent directory "C:/buildbot/.arm-ubuntu/usr/local/include" ignoring nonexistent directory "C:/buildbot/.arm-ubuntu/include" #include "..." search starts here: #include <...> search starts here: C:/buildbot/temp/llvm-project/libcxx\include C:/buildbot/temp/build/runtimes/runtimes-bins/libcxx\include\c++build C:/buildbot/temp/llvm-project/libcxx\test/support C:\buildbot\temp\build\lib\clang\12.0.0\include C:/buildbot/.arm-ubuntu/usr/include/arm-linux-gnueabihf C:/buildbot/.arm-ubuntu/usr/include End of search list. error: 'error' diagnostics seen but not expected: File C:/buildbot/temp/llvm-project/libcxx\include\memory Line 2033: no member named 'value' in 'std::__1::is_empty<std::__1::__compressed_pair<void (*)(Tag<5>), std::__1::default_delete<void (Tag<5>)>>>' 1 error generated.
Hi @hokein , I encounter a bug when clang parses enum and I have been recorded in https://bugs.llvm.org/show_bug.cgi?id=51554.
The source code like the following:
enum E { e = E() }; int main() { return 0; }
Some error message are expected like the following:
test.cpp:1:14: error: invalid use of incomplete type 'E' enum E { e = E() }; ^~~ test.cpp:1:6: note: definition of 'E' is not complete until the closing '}' enum E { e = E() };
Also, I have made some analyses like the following:
In ParseDecl.cpp: 1. llvm-10: AssignedVal.get(): NULL 2. llvm-12(Context.getLangOpts().RecoveryASTType: default false)(early-version): AssignedVal.get(): RecoveryExpr 0xaaaaba19df20 '<dependent type>' contains-errors lvalue 3. llvm-12(Context.getLangOpts().RecoveryASTType: default true) (latest-version, Finally crashed): AssignedVal.get()->dump(): RecoveryExpr 0xaaaabb4d9500 'enum E' contains-errors In CheckEnumConstant(), EltTy(type: QualType, value: EnumType 0xaaaabb517dd0 'enum E') cannot use getIntWidth(), so crashed. But the code doesn't seem to be wrong around here.
Could you please have a look at this issue? Thanks a lot.
I added a comment on the bug and sent https://reviews.llvm.org/D108451
This is a "rough edge" between erroneous and well-formed code and I'm not totally sure it's the perfect fix, but it does seem to be robust against crashes which is definitely he biggest thing.
this is really nice :-)