• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rieske / trans / 29861186803

21 Jul 2026 07:21PM UTC coverage: 91.142% (+0.4%) from 90.735%
29861186803

Pull #52

github

rieske
Fuzz test and fix issues
Pull Request #52: Fuzz test and fix issues

86 of 110 new or added lines in 9 files covered. (78.18%)

5371 of 5893 relevant lines covered (91.14%)

368979.09 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.57
/src/ast/FormalArgument.cpp
1
#include "FormalArgument.h"
2

3
#include "AbstractSyntaxTreeVisitor.h"
4

5
namespace ast {
6

7
FormalArgument::FormalArgument(DeclarationSpecifiers specifiers) :
8✔
8
        specifiers { specifiers }
8✔
9
{
10
}
8✔
11

12
FormalArgument::FormalArgument(DeclarationSpecifiers specifiers, std::unique_ptr<Declarator> declarator) :
176✔
13
        specifiers { specifiers },
176✔
14
        declarator { std::move(declarator) }
176✔
15
{
16
}
176✔
17

18
ast::FormalArgument::FormalArgument(FormalArgument&& rhs) :
674✔
19
        specifiers { std::move(rhs.specifiers) },
674✔
20
        declarator { std::move(rhs.declarator) }
1,348✔
21
{
22
}
674✔
23

24
void FormalArgument::accept(AbstractSyntaxTreeVisitor& visitor) {
542✔
25
    visitor.visit(*this);
542✔
26
}
542✔
27

28
void FormalArgument::visitSpecifiers(AbstractSyntaxTreeVisitor& visitor) {
364✔
29
    specifiers.accept(visitor);
364✔
30
}
364✔
31

32
void FormalArgument::visitDeclarator(AbstractSyntaxTreeVisitor& visitor) {
542✔
33
    if (declarator) {
542✔
34
        declarator->accept(visitor);
524✔
35
    }
36
}
542✔
37

38
type::Type FormalArgument::getType() const {
364✔
39
    // FIXME: terribly wrong
40
    auto baseType = specifiers.getTypeSpecifiers().at(0).getType();
364✔
41
    if (!declarator) {
364✔
42
        // Abstract parameter: `int f(int)` — type only, no name/declarator.
43
        return baseType;
12✔
44
    }
45
    return declarator->getFundamentalType(baseType);
352✔
46
}
364✔
47

48
std::string FormalArgument::getName() const {
182✔
49
    return declarator ? declarator->getName() : "";
194✔
50
}
51

52
translation_unit::Context FormalArgument::getDeclarationContext() const {
×
NEW
53
    if (declarator) {
×
NEW
54
        return declarator->getContext();
×
55
    }
NEW
56
    return translation_unit::Context { "", 0 };
×
57
}
58

59
bool FormalArgument::isVoid() const {
58✔
60
    return !declarator && specifiers.getTypeSpecifiers().at(0).getType().isVoid();
58✔
61
}
62

63
} // namespace ast
64

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc