re PR c++/71182 (parser.c cp_lexer_previous_token sanitizer detects member call on null pointer)
PR c++/71182 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the assertion, as lexer->buffer may be NULL. * g++.dg/cpp0x/pr71182.C: New test. From-SVN: r244070
This commit is contained in:
parent
fb85f9d05f
commit
066435fe10
4 changed files with 24 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2017-01-04 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/71182
|
||||
* parser.c (cp_lexer_previous_token): Use vec_safe_address in the
|
||||
assertion, as lexer->buffer may be NULL.
|
||||
|
||||
2017-01-04 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/77545
|
||||
|
|
|
@ -766,7 +766,7 @@ cp_lexer_previous_token (cp_lexer *lexer)
|
|||
/* Skip past purged tokens. */
|
||||
while (tp->purged_p)
|
||||
{
|
||||
gcc_assert (tp != lexer->buffer->address ());
|
||||
gcc_assert (tp != vec_safe_address (lexer->buffer));
|
||||
tp--;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2017-01-04 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/71182
|
||||
* g++.dg/cpp0x/pr71182.C: New test.
|
||||
|
||||
2017-01-04 Kelvin Nilsen <kelvin@gcc.gnu.org>
|
||||
|
||||
PR target/78056
|
||||
|
|
12
gcc/testsuite/g++.dg/cpp0x/pr71182.C
Normal file
12
gcc/testsuite/g++.dg/cpp0x/pr71182.C
Normal file
|
@ -0,0 +1,12 @@
|
|||
// PR c++/71182
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
class A {
|
||||
template <typename> void As();
|
||||
};
|
||||
template <typename T> class B : A {
|
||||
void f() {
|
||||
A *g ;
|
||||
g ? g->As<T>() : nullptr;
|
||||
}
|
||||
};
|
Loading…
Add table
Reference in a new issue