[PATCH] D17143: [Sema] PR25156 Crash when parsing dtor call on incomplete type

2017-06-11 Thread don hinton via Phabricator via cfe-commits
hintonda closed this revision.
hintonda added a comment.

Committed in r305169.


https://reviews.llvm.org/D17143



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17143: [Sema] PR25156 Crash when parsing dtor call on incomplete type

2017-06-11 Thread John McCall via cfe-commits
On Sun, Jun 11, 2017 at 9:26 AM, don hinton  wrote:

> On Sat, Jun 10, 2017 at 8:55 PM John McCall via Phabricator <
> revi...@reviews.llvm.org> wrote:
>
>> rjmccall accepted this revision.
>> rjmccall added a comment.
>> This revision is now accepted and ready to land.
>>
>> Thanks, looks great.
>
>
> Great, thanks.
>
>>
>>
>> If you're going to be submitting multiple patches, you should really ask
>> for commit access; it's not an arduous process.
>
>
> Sure, I'll look into it this week.
>
> In the meantime, would you mind commiting this one for me?
>

Sure thing, r305169.

John.


>
> Thanks again...
> don
>
>
>>
>>
>> https://reviews.llvm.org/D17143
>>
>>
>>
>>


-- 
I suppose you'd like my real thoughts as well.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17143: [Sema] PR25156 Crash when parsing dtor call on incomplete type

2017-06-11 Thread don hinton via cfe-commits
On Sat, Jun 10, 2017 at 8:55 PM John McCall via Phabricator <
revi...@reviews.llvm.org> wrote:

> rjmccall accepted this revision.
> rjmccall added a comment.
> This revision is now accepted and ready to land.
>
> Thanks, looks great.


Great, thanks.

>
>
> If you're going to be submitting multiple patches, you should really ask
> for commit access; it's not an arduous process.


Sure, I'll look into it this week.

In the meantime, would you mind commiting this one for me?

Thanks again...
don


>
>
> https://reviews.llvm.org/D17143
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D17143: [Sema] PR25156 Crash when parsing dtor call on incomplete type

2017-06-10 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.

Thanks, looks great.

If you're going to be submitting multiple patches, you should really ask for 
commit access; it's not an arduous process.


https://reviews.llvm.org/D17143



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D17143: [Sema] PR25156 Crash when parsing dtor call on incomplete type

2017-06-09 Thread don hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 102103.
hintonda added a comment.

- Addressed comments.


https://reviews.llvm.org/D17143

Files:
  lib/Sema/SemaExprCXX.cpp
  test/SemaCXX/nested-name-spec.cpp


Index: test/SemaCXX/nested-name-spec.cpp
===
--- test/SemaCXX/nested-name-spec.cpp
+++ test/SemaCXX/nested-name-spec.cpp
@@ -169,6 +169,13 @@
 struct Y;  // expected-note{{forward declaration of 'Y'}}
 Y::foo y; // expected-error{{incomplete type 'Y' named in nested name 
specifier}}
 
+namespace PR25156 {
+struct Y;  // expected-note{{forward declaration of 'PR25156::Y'}}
+void foo() {
+  Y::~Y(); // expected-error{{incomplete type 'PR25156::Y' named in nested 
name specifier}}
+}
+}
+
 X::X() : a(5) { } // expected-error{{use of undeclared identifier 'X'}}
 
 struct foo_S {
Index: lib/Sema/SemaExprCXX.cpp
===
--- lib/Sema/SemaExprCXX.cpp
+++ lib/Sema/SemaExprCXX.cpp
@@ -189,12 +189,15 @@
 // have one) and, if that fails to find a match, in the scope (if
 // we're allowed to look there).
 Found.clear();
-if (Step == 0 && LookupCtx)
+if (Step == 0 && LookupCtx) {
+  if (RequireCompleteDeclContext(SS, LookupCtx))
+return nullptr;
   LookupQualifiedName(Found, LookupCtx);
-else if (Step == 1 && LookInScope && S)
+} else if (Step == 1 && LookInScope && S) {
   LookupName(Found, S);
-else
+} else {
   continue;
+}
 
 // FIXME: Should we be suppressing ambiguities here?
 if (Found.isAmbiguous())


Index: test/SemaCXX/nested-name-spec.cpp
===
--- test/SemaCXX/nested-name-spec.cpp
+++ test/SemaCXX/nested-name-spec.cpp
@@ -169,6 +169,13 @@
 struct Y;  // expected-note{{forward declaration of 'Y'}}
 Y::foo y; // expected-error{{incomplete type 'Y' named in nested name specifier}}
 
+namespace PR25156 {
+struct Y;  // expected-note{{forward declaration of 'PR25156::Y'}}
+void foo() {
+  Y::~Y(); // expected-error{{incomplete type 'PR25156::Y' named in nested name specifier}}
+}
+}
+
 X::X() : a(5) { } // expected-error{{use of undeclared identifier 'X'}}
 
 struct foo_S {
Index: lib/Sema/SemaExprCXX.cpp
===
--- lib/Sema/SemaExprCXX.cpp
+++ lib/Sema/SemaExprCXX.cpp
@@ -189,12 +189,15 @@
 // have one) and, if that fails to find a match, in the scope (if
 // we're allowed to look there).
 Found.clear();
-if (Step == 0 && LookupCtx)
+if (Step == 0 && LookupCtx) {
+  if (RequireCompleteDeclContext(SS, LookupCtx))
+return nullptr;
   LookupQualifiedName(Found, LookupCtx);
-else if (Step == 1 && LookInScope && S)
+} else if (Step == 1 && LookInScope && S) {
   LookupName(Found, S);
-else
+} else {
   continue;
+}
 
 // FIXME: Should we be suppressing ambiguities here?
 if (Found.isAmbiguous())
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D17143: [Sema] PR25156 Crash when parsing dtor call on incomplete type

2017-06-09 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments.



Comment at: lib/Sema/SemaExprCXX.cpp:192
 Found.clear();
-if (Step == 0 && LookupCtx)
+if (Step == 0 && LookupCtx && !RequireCompleteDeclContext(SS, LookupCtx))
   LookupQualifiedName(Found, LookupCtx);

You should probably respond to the incomplete context within this case (by 
returning nullptr, I guess) instead of falling down into the else.


https://reviews.llvm.org/D17143



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D17143: [Sema] PR25156 Crash when parsing dtor call on incomplete type

2017-06-09 Thread don hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 102049.
hintonda added a comment.

Rebase and move test to existing file.


https://reviews.llvm.org/D17143

Files:
  lib/Sema/SemaExprCXX.cpp
  test/SemaCXX/nested-name-spec.cpp


Index: test/SemaCXX/nested-name-spec.cpp
===
--- test/SemaCXX/nested-name-spec.cpp
+++ test/SemaCXX/nested-name-spec.cpp
@@ -169,6 +169,13 @@
 struct Y;  // expected-note{{forward declaration of 'Y'}}
 Y::foo y; // expected-error{{incomplete type 'Y' named in nested name 
specifier}}
 
+namespace PR25156 {
+struct Y;  // expected-note{{forward declaration of 'PR25156::Y'}}
+void foo() {
+  Y::~Y(); // expected-error{{incomplete type 'PR25156::Y' named in nested 
name specifier}}
+}
+}
+
 X::X() : a(5) { } // expected-error{{use of undeclared identifier 'X'}}
 
 struct foo_S {
Index: lib/Sema/SemaExprCXX.cpp
===
--- lib/Sema/SemaExprCXX.cpp
+++ lib/Sema/SemaExprCXX.cpp
@@ -189,7 +189,7 @@
 // have one) and, if that fails to find a match, in the scope (if
 // we're allowed to look there).
 Found.clear();
-if (Step == 0 && LookupCtx)
+if (Step == 0 && LookupCtx && !RequireCompleteDeclContext(SS, LookupCtx))
   LookupQualifiedName(Found, LookupCtx);
 else if (Step == 1 && LookInScope && S)
   LookupName(Found, S);


Index: test/SemaCXX/nested-name-spec.cpp
===
--- test/SemaCXX/nested-name-spec.cpp
+++ test/SemaCXX/nested-name-spec.cpp
@@ -169,6 +169,13 @@
 struct Y;  // expected-note{{forward declaration of 'Y'}}
 Y::foo y; // expected-error{{incomplete type 'Y' named in nested name specifier}}
 
+namespace PR25156 {
+struct Y;  // expected-note{{forward declaration of 'PR25156::Y'}}
+void foo() {
+  Y::~Y(); // expected-error{{incomplete type 'PR25156::Y' named in nested name specifier}}
+}
+}
+
 X::X() : a(5) { } // expected-error{{use of undeclared identifier 'X'}}
 
 struct foo_S {
Index: lib/Sema/SemaExprCXX.cpp
===
--- lib/Sema/SemaExprCXX.cpp
+++ lib/Sema/SemaExprCXX.cpp
@@ -189,7 +189,7 @@
 // have one) and, if that fails to find a match, in the scope (if
 // we're allowed to look there).
 Found.clear();
-if (Step == 0 && LookupCtx)
+if (Step == 0 && LookupCtx && !RequireCompleteDeclContext(SS, LookupCtx))
   LookupQualifiedName(Found, LookupCtx);
 else if (Step == 1 && LookInScope && S)
   LookupName(Found, S);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits