Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,8 @@ Crash and bug fixes
``[[assume(expr)]]`` attribute was enclosed in parentheses. (#GH151529)
- Fixed a crash when parsing ``#embed`` parameters with unmatched closing brackets. (#GH152829)
- Fixed a crash when compiling ``__real__`` or ``__imag__`` unary operator on scalar value with type promotion. (#GH160583)
- Fixed a crash when parsing invalid nested name specifier sequences
containing a single colon. (#GH167905)

Improvements
^^^^^^^^^^^^
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/Parse/ParseTentative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,8 @@ Parser::isCXXDeclarationSpecifier(ImplicitTypenameContext AllowImplicitTypename,
return TPResult::False;
}

if (Next.isNot(tok::coloncolon) && Next.isNot(tok::less)) {
if (Next.isNot(tok::coloncolon) && Next.isNot(tok::less) &&
Next.isNot(tok::colon)) {
// Determine whether this is a valid expression. If not, we will hit
// a parse error one way or another. In that case, tell the caller that
// this is ambiguous. Typo-correct to type and expression keywords and
Expand Down
10 changes: 10 additions & 0 deletions clang/test/Parser/cxx-nested-name-spec.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s

namespace a { b c ( a:c::
// expected-error@-1 {{unknown type name 'b'}}
// expected-error@-2 {{unexpected ':' in nested name specifier; did you mean '::'?}}
// expected-error@-3 {{no member named 'c' in namespace 'a'}}
// expected-error@-4 {{expected ';' after top level declarator}}
// expected-note@-5 {{to match this '{'}}
// expected-error@+1 {{expected unqualified-id}} \
// expected-error@+1 {{expected '}'}}
Loading