aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-14 21:16:09 +0000
committerChris Lattner <sabre@nondot.org>2009-04-14 21:16:09 +0000
commitb6645dd9ca7a44e9b5f657e14820d5edcc511ee5 (patch)
tree348ea8c9982a0242ddaf0fe45cdd0aabbcd9e50c /lib/Parse/ParseDecl.cpp
parent1fc5194039fc01e84af46342bf6e0790f0ebb58c (diff)
Fix a regression in a previous patch that broke implicit
int in a bitfield. Shantonu found this in a gcc testsuite file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 1fe0d93d1c..a416838250 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -440,7 +440,8 @@ void Parser::ParseSpecifierQualifierList(DeclSpec &DS) {
// Validate declspec for type-name.
unsigned Specs = DS.getParsedSpecifiers();
- if (Specs == DeclSpec::PQ_None && !DS.getNumProtocolQualifiers())
+ if (Specs == DeclSpec::PQ_None && !DS.getNumProtocolQualifiers() &&
+ !DS.getAttributes())
Diag(Tok, diag::err_typename_requires_specqual);
// Issue diagnostic and remove storage class if present.
@@ -475,6 +476,7 @@ void Parser::ParseSpecifierQualifierList(DeclSpec &DS) {
/// int x = 17; // init-declarator-list
/// int x , y; // init-declarator-list
/// int x __asm__ ("foo"); // init-declarator-list
+/// int x : 4; // struct-declarator
/// int x { 5}; // C++'0x unified initializers
///
/// This is not, because 'x' does not immediately follow the declspec (though
@@ -484,7 +486,7 @@ void Parser::ParseSpecifierQualifierList(DeclSpec &DS) {
static bool isValidAfterIdentifierInDeclarator(const Token &T) {
return T.is(tok::l_square) || T.is(tok::l_paren) || T.is(tok::r_paren) ||
T.is(tok::semi) || T.is(tok::comma) || T.is(tok::equal) ||
- T.is(tok::kw_asm) || T.is(tok::l_brace);
+ T.is(tok::kw_asm) || T.is(tok::l_brace) || T.is(tok::colon);
}
/// ParseDeclarationSpecifiers