mirror of https://github.com/microsoft/clang.git
Replace completely bogus ambiguous-compound-literal-in-C++ code with something
that isn't always wrong. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208844 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ae2d06735f
commit
537ec10ebc
|
@ -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