summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2017-07-11 10:56:19 +0200
committerNikolai Kosjar <nikolai.kosjar@qt.io>2017-07-13 13:23:30 +0000
commite88fcdbdb6ae7cc19d2ea47e06e5f65c77b4baf7 (patch)
tree0e4408f33221e0f0245a55d21902facabe1aa1bc /dist
parent7865bb67d4806a6b061a2e89d9bd0d1925b9eab3 (diff)
downloadqt-creator-e88fcdbdb6ae7cc19d2ea47e06e5f65c77b4baf7.tar.gz
Clang: Add patch fixing crash on reparse
...in preamble serialization. https://bugs.llvm.org/show_bug.cgi?id=20320 Change-Id: I241a04ffae7ebb1dc241bed81f2036178a86afb9 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'dist')
-rw-r--r--dist/clang/patches/D21176_Mark-invalid-RecordDecls-as-completed.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/dist/clang/patches/D21176_Mark-invalid-RecordDecls-as-completed.patch b/dist/clang/patches/D21176_Mark-invalid-RecordDecls-as-completed.patch
new file mode 100644
index 0000000000..a43fc88e99
--- /dev/null
+++ b/dist/clang/patches/D21176_Mark-invalid-RecordDecls-as-completed.patch
@@ -0,0 +1,38 @@
+diff --git a/tools/clang/lib/Sema/SemaDecl.cpp b/tools/clang/lib/Sema/SemaDecl.cpp
+index 41719d4e7b..747a4cc0c5 100644
+--- a/tools/clang/lib/Sema/SemaDecl.cpp
++++ b/tools/clang/lib/Sema/SemaDecl.cpp
+@@ -13112,7 +13112,14 @@ CreateNewDecl:
+ OwnedDecl = true;
+ // In C++, don't return an invalid declaration. We can't recover well from
+ // the cases where we make the type anonymous.
+- return (Invalid && getLangOpts().CPlusPlus) ? nullptr : New;
++ if (Invalid && getLangOpts().CPlusPlus) {
++ if (New->isBeingDefined())
++ if (auto RD = dyn_cast<RecordDecl>(New))
++ RD->completeDefinition();
++ return nullptr;
++ } else {
++ return New;
++ }
+ }
+
+ void Sema::ActOnTagStartDefinition(Scope *S, Decl *TagD) {
+diff --git a/tools/clang/test/SemaCXX/conversion-function.cpp b/tools/clang/test/SemaCXX/conversion-function.cpp
+index 3f494cce8c..c725a0d5b7 100644
+--- a/tools/clang/test/SemaCXX/conversion-function.cpp
++++ b/tools/clang/test/SemaCXX/conversion-function.cpp
+@@ -434,8 +434,12 @@ namespace PR18234 {
+ struct A {
+ operator enum E { e } (); // expected-error {{'PR18234::A::E' cannot be defined in a type specifier}}
+ operator struct S { int n; } (); // expected-error {{'PR18234::A::S' cannot be defined in a type specifier}}
++ // expected-note@-1 {{candidate constructor (the implicit copy constructor) not viable: no known conversion from 'struct A' to 'const PR18234::A::S &' for 1st argument}}
++#if __cplusplus >= 201103L
++ // expected-note@-3 {{candidate constructor (the implicit move constructor) not viable: no known conversion from 'struct A' to 'PR18234::A::S &&' for 1st argument}}
++#endif
+ } a;
+- A::S s = a;
++ A::S s = a; // expected-error {{no viable conversion from 'struct A' to 'A::S'}}
+ A::E e = a; // expected-note {{here}}
+ bool k1 = e == A::e; // expected-error {{no member named 'e'}}
+ bool k2 = e.n == 0;