Skip to content

Commit d6a23f0

Browse files
committed
C++ front-end: fix parentheses matching for alignas parsing
We had parentheses consumed by rCommaExpression while still expecting to find one after this rule executed.
1 parent 6a2e975 commit d6a23f0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

regression/cpp/type_traits_essentials1/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ template<typename T> using x=V<T>;
3030
using type __attribute__((__nodebug__)) = int;
3131
#endif
3232

33+
struct alignas(0x1) t
34+
{
35+
char c;
36+
};
37+
3338
template<typename T>
3439
class C
3540
{

src/cpp/parse.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,9 +2115,8 @@ bool Parser::optAlignas(typet &cv)
21152115

21162116
typet tname;
21172117
cpp_tokent op, cp;
2118-
2119-
cpp_token_buffert::post pos=lex.Save();
21202118
lex.get_token(op);
2119+
cpp_token_buffert::post pos = lex.Save();
21212120

21222121
if(rTypeName(tname))
21232122
{

0 commit comments

Comments
 (0)