aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-04 22:46:25 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-04 22:46:25 +0000
commiteeb15d499f032bb89773ddaca2d17475122a37bb (patch)
treee74f990d3f40d2c180b21d0e7f8b9a57148792c2 /lib/Sema/Sema.cpp
parent98eb8a7a702b95183ed015706b1f1c66f5cb27a4 (diff)
Implement semantic analysis for the GNU flexible array initialization
extension. The interaction with designated initializers is a bit... interesting... but we follow GNU's lead and don't permit too much crazy code in this area. Also, make the "excess initializers" error message a bit more informative. Addresses PR2561: http://llvm.org/bugs/show_bug.cgi?id=2561 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r--lib/Sema/Sema.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 03a6b3c98a..028c9ebf4f 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -50,11 +50,13 @@ static void ConvertArgToStringFn(Diagnostic::ArgumentKind Kind, intptr_t Val,
"Invalid modifier for DeclarationName argument");
} else {
assert(Kind == Diagnostic::ak_nameddecl);
- assert(ModLen == 1 && Modifier[0] == 'q' && ArgLen == 0 &&
+ if (ModLen == 1 && Modifier[0] == 'q' && ArgLen == 0)
+ S = reinterpret_cast<NamedDecl*>(Val)->getQualifiedNameAsString();
+ else {
+ assert(ModLen == 0 && ArgLen == 0 &&
"Invalid modifier for NamedDecl* argument");
-
- S = reinterpret_cast<NamedDecl*>(Val)->getQualifiedNameAsString();
-
+ S = reinterpret_cast<NamedDecl*>(Val)->getNameAsString();
+ }
}
Output.append(S.begin(), S.end());
}