forked from OSchip/llvm-project
Replace completely bogus ambiguous-compound-literal-in-C++ code with something
that isn't always wrong. llvm-svn: 208844
This commit is contained in:
parent
87e11a426d
commit
aba8b36abf
|
@ -2998,8 +2998,10 @@ Parser::ParseCXXAmbiguousParenExpression(ParenParseOption &ExprType,
|
|||
|
||||
if (ParseAs == CompoundLiteral) {
|
||||
ExprType = CompoundLiteral;
|
||||
// FIXME: This is entirely wrong.
|
||||
TypeResult Ty = ParseTypeName();
|
||||
if (DeclaratorInfo.isInvalidType())
|
||||
return ExprError();
|
||||
|
||||
TypeResult Ty = Actions.ActOnTypeName(getCurScope(), DeclaratorInfo);
|
||||
return ParseCompoundLiteralExpression(Ty.get(),
|
||||
Tracker.getOpenLocation(),
|
||||
Tracker.getCloseLocation());
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -x c++ %s
|
||||
// expected-no-diagnostics
|
||||
int main() {
|
||||
char *s;
|
||||
s = (char []){"whatever"};
|
||||
s = (char []){"whatever"};
|
||||
s = (char(*)){s};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue