Skip to content

Commit 9dfe16f

Browse files
committed
Allow compileAttributes parse function declaration
such as unsigned int factorial(unsigned int);
1 parent 420f4cf commit 9dfe16f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/attributes.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,12 +1162,12 @@ namespace attributes {
11621162
for (int i = lineNumber; i<lines_.size(); i++) {
11631163
std::string line;
11641164
line = lines_[i];
1165-
std::string::size_type bracePos = line.find('{');
1166-
if (bracePos == std::string::npos) {
1165+
std::string::size_type end = line.find_first_of("{;");
1166+
if (end == std::string::npos) {
11671167
signature.append(line);
11681168
signature.push_back(' ');
11691169
} else {
1170-
signature.append(line.substr(0, bracePos));
1170+
signature.append(line.substr(0, end));
11711171
return signature;
11721172
}
11731173
}

0 commit comments

Comments
 (0)