Skip to content

Commit 56bb936

Browse files
committed
Get /W4 and -Wall -Wextra clean again, closes #173
1 parent c39a94c commit 56bb936

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

source/cppfront.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,8 @@ class cppfront
652652
bool suppress_move_from_last_use = false;
653653

654654
struct arg_info {
655-
passing_style pass = passing_style::in;
656-
token const* token = nullptr;
655+
passing_style pass = passing_style::in;
656+
token const* ptoken = nullptr;
657657
};
658658
std::vector<arg_info> current_args = { {} };
659659

@@ -1099,7 +1099,7 @@ class cppfront
10991099
// For an explicit 'forward' apply forwarding to correct identifier
11001100
assert (!current_args.empty());
11011101
if (current_args.back().pass == passing_style::forward) {
1102-
add_std_forward = current_args.back().token == n.identifier;
1102+
add_std_forward = current_args.back().ptoken == n.identifier;
11031103
}
11041104

11051105
if (add_std_move) {
@@ -1628,9 +1628,9 @@ class cppfront
16281628
if (current_args.back().pass == passing_style::forward)
16291629
{
16301630
assert (n.expr->get_token());
1631-
assert (!current_args.back().token);
1632-
current_args.back().token = n.expr->get_token();
1633-
auto decl = sema.get_local_declaration_of(*current_args.back().token);
1631+
assert (!current_args.back().ptoken);
1632+
current_args.back().ptoken = n.expr->get_token();
1633+
auto decl = sema.get_local_declaration_of(*current_args.back().ptoken);
16341634
if (!(decl && decl->parameter && decl->parameter->pass == passing_style::forward)) {
16351635
errors.emplace_back(
16361636
n.position(),

source/load.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,7 @@ auto process_cpp_line(
382382
bool& in_raw_string_literal,
383383
std::string& raw_string_closing_seq,
384384
braces_tracker& braces,
385-
lineno_t lineno,
386-
std::vector<error>& errors
385+
lineno_t lineno
387386
)
388387
-> process_line_ret
389388
{
@@ -637,6 +636,8 @@ class source
637636
braces.found_pre_else();
638637
break;case preprocessor_conditional::pre_endif:
639638
braces.found_pre_endif();
639+
break;default:
640+
assert(false);
640641
}
641642
}
642643
};
@@ -714,8 +715,7 @@ class source
714715
in_raw_string_literal,
715716
raw_string_closing_seq,
716717
braces,
717-
std::ssize(lines) - 1,
718-
errors
718+
std::ssize(lines) - 1
719719
);
720720
if (stats.all_comment_line) {
721721
lines.back().cat = source_line::category::comment;

0 commit comments

Comments
 (0)