Skip to content

Commit a2657da

Browse files
committed
Add hackyy deduced this support
1 parent 2ecb6bf commit a2657da

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

src/libs/3rdparty/cplusplus/FullySpecifiedType.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ FullySpecifiedType FullySpecifiedType::qualifiedType() const
5050
ty.setExtern(false);
5151
ty.setMutable(false);
5252
ty.setTypedef(false);
53+
ty.setThis(false);
5354

5455
ty.setInline(false);
5556
ty.setVirtual(false);

src/libs/3rdparty/cplusplus/FullySpecifiedType.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ class CPLUSPLUS_EXPORT FullySpecifiedType final
7373
bool isTypedef() const { return f._isTypedef; }
7474
void setTypedef(bool isTypedef) { f._isTypedef = isTypedef; }
7575

76+
bool isThis() const { return f._isThis; }
77+
void setThis(bool isThis) { f._isThis = isThis; }
78+
7679
bool isInline() const { return f._isInline; }
7780
void setInline(bool isInline) { f._isInline = isInline; }
7881

@@ -132,6 +135,7 @@ class CPLUSPLUS_EXPORT FullySpecifiedType final
132135
unsigned _isExtern: 1;
133136
unsigned _isMutable: 1;
134137
unsigned _isTypedef: 1;
138+
unsigned _isThis: 1;
135139

136140
// function specifiers
137141
unsigned _isInline: 1;

src/libs/3rdparty/cplusplus/Parser.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,6 +1767,13 @@ bool Parser::parseDeclSpecifierSeq(SpecifierListAST *&decl_specifier_seq,
17671767
bool has_type_specifier = false;
17681768
NameAST *named_type_specifier = nullptr;
17691769
SpecifierListAST **decl_specifier_seq_ptr = &decl_specifier_seq;
1770+
if (LA() == T_THIS) {
1771+
// this is a placeholder-type-specifier
1772+
SimpleSpecifierAST *spec = new (_pool) SimpleSpecifierAST;
1773+
spec->specifier_token = consumeToken();
1774+
*decl_specifier_seq_ptr = new (_pool) SpecifierListAST(spec);
1775+
decl_specifier_seq_ptr = &(*decl_specifier_seq_ptr)->next;
1776+
}
17701777
for (;;) {
17711778
PlaceholderTypeSpecifierAST *placeholderSpec = nullptr;
17721779
// A simple auto is also technically a placeholder-type-specifier, but for historical

src/libs/3rdparty/cplusplus/Symbols.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ class CPLUSPLUS_EXPORT Function final : public Scope, public Type
359359
bool isTrailingReturnType() const { return f._isTrailingReturnType; }
360360
void setTrailingReturnType(bool isTrailingReturnType) { f._isTrailingReturnType = isTrailingReturnType; }
361361

362+
bool hasThisArgument() const { return f._hasThisArgument; }
363+
void setHasThisArgument(bool hasThisArgument) { f._hasThisArgument = hasThisArgument; }
364+
362365
bool maybeValidPrototype(int actualArgumentCount) const;
363366

364367
const StringLiteral *exceptionSpecification() { return _exceptionSpecification; }
@@ -396,6 +399,7 @@ class CPLUSPLUS_EXPORT Function final : public Scope, public Type
396399
unsigned _methodKey: 3;
397400
unsigned _refQualifier: 2;
398401
unsigned _isTrailingReturnType :1;
402+
unsigned _hasThisArgument :1;
399403
};
400404
union {
401405
unsigned _flags;

0 commit comments

Comments
 (0)