if (Loc.getTypeLocClass() == TypeLoc::Elaborated) {
NestedNameSpecifierLoc NestedNameSpecifier =
Loc.castAs<ElaboratedTypeLoc>().getQualifierLoc();
- // This happens for friend declaration of a base class with injected class
- // name.
- if (!NestedNameSpecifier.getNestedNameSpecifier())
- return;
- const Type *SpecifierType =
- NestedNameSpecifier.getNestedNameSpecifier()->getAsType();
- if (SpecifierType && SpecifierType->isRecordType())
- return;
+ // FIXME: avoid changing injected class names.
+ if (auto *NNS = NestedNameSpecifier.getNestedNameSpecifier()) {
+ const Type *SpecifierType = NNS->getAsType();
+ if (SpecifierType && SpecifierType->isRecordType())
+ return;
+ }
}
fixTypeLoc(Result, startLocationForType(Loc), endLocationForType(Loc), Loc);
} else if (const auto *VarRef =
// Uses of most types: just look at what the typeLoc refers to.
MatchFinder->addMatcher(
typeLoc(isExpansionInMainFile(),
- loc(qualType(hasDeclaration(Types.bind("use"))))),
+ loc(qualType(allOf(unless(elaboratedType()),
+ hasDeclaration(Types.bind("use")))))),
this);
// Uses of typedefs: these are often transparent to hasDeclaration, so we need
// to handle them explicitly.
const auto ConstantExpr = ignoringParenImpCasts(
anyOf(integerLiteral(), unaryOperator(hasUnaryOperand(IntegerExpr)),
binaryOperator(hasLHS(IntegerExpr), hasRHS(IntegerExpr))));
- const auto IntegerCallExpr = ignoringParenImpCasts(
- callExpr(anyOf(hasType(isInteger()), hasType(enumType())),
- unless(isInTemplateInstantiation())));
+ const auto IntegerCallExpr = ignoringParenImpCasts(callExpr(
+ anyOf(hasType(isInteger()), hasType(hasCanonicalType(enumType()))),
+ unless(isInTemplateInstantiation())));
const auto SizeOfExpr = sizeOfExpr(hasArgumentOfType(
hasUnqualifiedDesugaredType(type().bind("sizeof-arg-type"))));
const auto SizeOfZero =
const auto StructAddrOfExpr = unaryOperator(
hasOperatorName("&"), hasUnaryOperand(ignoringParenImpCasts(
hasType(hasCanonicalType(recordType())))));
- const auto PointerToStructType =
- hasUnqualifiedDesugaredType(pointerType(pointee(recordType())));
+ const auto PointerToStructType = hasUnqualifiedDesugaredType(
+ pointerType(pointee(hasCanonicalType(recordType()))));
const auto PointerToStructExpr = ignoringParenImpCasts(expr(
hasType(hasCanonicalType(PointerToStructType)), unless(cxxThisExpr())));
auto FindConstructExpr =
cxxConstructExpr(
hasDeclaration(FindConstructor), argumentCountIs(1),
- hasArgument(
- 0, cxxNewExpr(isArray(), hasType(pointerType(pointee(
- equalsBoundNode(PointerTypeN)))))
- .bind(NewExprN)))
+ hasArgument(0,
+ cxxNewExpr(isArray(),
+ hasType(hasCanonicalType(pointerType(
+ pointee(equalsBoundNode(PointerTypeN))))))
+ .bind(NewExprN)))
.bind(ConstructExprN);
Finder->addMatcher(FindConstructExpr, this);
}
SourceRange TemplateArgumentRange = TSTypeLoc.getArgLoc(0)
.getTypeSourceInfo()
->getTypeLoc()
- .getLocalSourceRange();
+ .getSourceRange();
D << TemplateArgumentRange;
if (isInSingleDeclStmt(VarOrField)) {
// case of overloaded functions, so detection of redundant casts is trickier
// in this case. Don't emit "redundant cast" warnings for function
// pointer/reference types.
- if (SourceTypeAsWritten == DestTypeAsWritten) {
+ QualType Src = SourceTypeAsWritten, Dst = DestTypeAsWritten;
+ if (const auto *ElTy = dyn_cast<ElaboratedType>(Src))
+ Src = ElTy->getNamedType();
+ if (const auto *ElTy = dyn_cast<ElaboratedType>(Dst))
+ Dst = ElTy->getNamedType();
+ if (Src == Dst) {
diag(CastExpr->getBeginLoc(), "redundant cast to the same type")
<< FixItHint::CreateRemoval(ReplaceRange);
return;
// otherwise the matcher does not work correctly, because it
// will not explicitly ignore enum conditions.
unless(ignoringImpCasts(
- declRefExpr(hasType(enumType())).bind("enum-condition"))))))
+ declRefExpr(hasType(hasCanonicalType(enumType())))
+ .bind("enum-condition"))))))
.bind("switch"),
this);
pointee(anyOf(isConstQualified(), ignoringParens(functionType()))))));
Finder->addMatcher(
- valueDecl(
- hasType(isConstQualified()),
- hasType(typedefType(hasDeclaration(anyOf(
- typedefDecl(NonConstAndNonFunctionPointerType).bind("typedef"),
- typeAliasDecl(NonConstAndNonFunctionPointerType)
- .bind("typeAlias"))))))
+ valueDecl(hasType(qualType(
+ isConstQualified(),
+ elaboratedType(namesType(typedefType(hasDeclaration(
+ anyOf(typedefDecl(NonConstAndNonFunctionPointerType)
+ .bind("typedef"),
+ typeAliasDecl(NonConstAndNonFunctionPointerType)
+ .bind("typeAlias")))))))))
.bind("decl"),
this);
}
return true;
if (const auto *Cast = Parents[0].get<ImplicitCastExpr>()) {
if ((Cast->getCastKind() == CK_NoOp &&
- Cast->getType() == E->getType().withConst()) ||
+ Context->hasSameType(Cast->getType(), E->getType().withConst())) ||
(Cast->getCastKind() == CK_LValueToRValue &&
!Cast->getType().isNull() && Cast->getType()->isFundamentalType()))
return false;
static TypeMatcher notTemplateSpecConstRefType() {
return lValueReferenceType(
- pointee(unless(templateSpecializationType()), isConstQualified()));
+ pointee(unless(elaboratedType(namesType(templateSpecializationType()))),
+ isConstQualified()));
}
static TypeMatcher nonConstValueType() {
// ((Base*)this)->operator=((Base)Other);
//
// So we are looking for a member call that fulfills:
- if (match(traverse(TK_AsIs,
- compoundStmt(has(ignoringParenImpCasts(cxxMemberCallExpr(
- // - The object is an implicit cast of 'this' to a
- // pointer to
- // a base class.
- onImplicitObjectArgument(implicitCastExpr(
- hasImplicitDestinationType(
- pointsTo(type(equalsNode(Base)))),
- hasSourceExpression(cxxThisExpr()))),
- // - The called method is the operator=.
- callee(cxxMethodDecl(isCopyAssignmentOperator())),
- // - The argument is (an implicit cast to a Base of)
- // the argument taken by "Operator".
- argumentCountIs(1),
- hasArgument(0, declRefExpr(to(varDecl(
- equalsNode(Param)))))))))),
+ if (match(traverse(
+ TK_AsIs,
+ compoundStmt(has(ignoringParenImpCasts(cxxMemberCallExpr(
+ // - The object is an implicit cast of 'this' to a
+ // pointer to
+ // a base class.
+ onImplicitObjectArgument(implicitCastExpr(
+ hasImplicitDestinationType(hasCanonicalType(pointsTo(
+ type(equalsNode(Base->getCanonicalTypeInternal()
+ .getTypePtr()))))),
+ hasSourceExpression(cxxThisExpr()))),
+ // - The called method is the operator=.
+ callee(cxxMethodDecl(isCopyAssignmentOperator())),
+ // - The argument is (an implicit cast to a Base of)
+ // the argument taken by "Operator".
+ argumentCountIs(1),
+ hasArgument(
+ 0, declRefExpr(to(varDecl(equalsNode(Param)))))))))),
*Compound, *Context)
.empty())
return false;
if (TL.getQualifierLoc() &&
!TraverseNestedNameSpecifierLoc(TL.getQualifierLoc()))
return false;
- return TraverseTypeLoc(TL.getNamedTypeLoc(), true);
+ const auto *T = TL.getTypePtr();
+ return TraverseTypeLoc(TL.getNamedTypeLoc(),
+ T->getKeyword() != ETK_None || T->getQualifier());
}
bool VisitDeclRefExpr(DeclRefExpr *S) {
// ElaboratedTypeLoc will reports information for its inner type loc.
// Otherwise we loose information about inner types loc's qualifier.
TypeLoc Inner = L.getNamedTypeLoc().getUnqualifiedLoc();
- TypeLocsToSkip.insert(Inner.getBeginLoc());
+ if (L.getBeginLoc() == Inner.getBeginLoc())
+ return RecursiveASTVisitor::TraverseTypeLoc(Inner);
+ else
+ TypeLocsToSkip.insert(Inner.getBeginLoc());
return RecursiveASTVisitor::TraverseElaboratedTypeLoc(L);
}
template<typename T> class Foo {};
^auto v = Foo<X>();
)cpp",
- "Foo<class X>",
+ "Foo<X>",
},
{
R"cpp( // auto on initializer list.
return Foo();
}
)cpp",
- "struct Foo",
+ "Foo",
},
{
R"cpp( // decltype in trailing return type
return Foo();
}
)cpp",
- "struct Foo",
+ "Foo",
},
{
R"cpp( // auto in function return type
return Foo();
}
)cpp",
- "struct Foo",
+ "Foo",
},
{
R"cpp( // auto& in function return type
return x;
}
)cpp",
- "struct Foo",
+ "Foo",
},
{
R"cpp( // auto* in function return type
return x;
}
)cpp",
- "struct Foo",
+ "Foo",
},
{
R"cpp( // const auto& in function return type
return x;
}
)cpp",
- "struct Foo",
+ "Foo",
},
{
R"cpp( // decltype(auto) in function return (value)
return Foo();
}
)cpp",
- "struct Foo",
+ "Foo",
},
{
R"cpp( // decltype(auto) in function return (ref)
return (x);
}
)cpp",
- "struct Foo &",
+ "Foo &",
},
{
R"cpp( // decltype(auto) in function return (const ref)
return (x);
}
)cpp",
- "const struct Foo &",
+ "const Foo &",
},
{
R"cpp( // auto on alias
expression: DeclRef - operator+
expression: MaterializeTemporary - lvalue
expression: CXXTemporaryObject - Foo
- type: Record - Foo
+ type: Elaborated
+ type: Record - Foo
expression: IntegerLiteral - 42
)"},
{R"cpp(
{
R"cpp(
void foo() {
- class {} $0^x;
- int (*$1^fptr)(int $2^a, int) = nullptr;
+ $0^class {} $1^x;
+ int (*$2^fptr)(int $3^a, int) = nullptr;
}
)cpp",
- "0: targets = {x}, decl\n"
- "1: targets = {fptr}, decl\n"
- "2: targets = {a}, decl\n"},
+ "0: targets = {}\n"
+ "1: targets = {x}, decl\n"
+ "2: targets = {fptr}, decl\n"
+ "3: targets = {a}, decl\n"},
// Namespace aliases should be handled properly.
{
R"cpp(
[](HoverInfo &HI) {
HI.Name = "auto";
HI.Kind = index::SymbolKind::TypeAlias;
- HI.Definition = "struct S";
+ HI.Definition = "S";
}},
// undeduced auto
{R"cpp(
HI.NamespaceScope = "";
HI.Definition = "Color x = RED";
HI.Kind = index::SymbolKind::Variable;
- HI.Type = "enum Color";
+ HI.Type = "Color";
HI.Value = "RED (0xffffff85)"; // Symbolic on an expression.
}},
{R"cpp(
HI.Kind = index::SymbolKind::Variable;
HI.NamespaceScope = "";
HI.Definition = "X x";
- HI.Type = "struct X";
+ HI.Type = "X";
}},
{// Don't crash on null types.
R"cpp(auto [^[[x]]] = 1; /*error-ok*/)cpp",
[](HoverInfo &HI) {
HI.Name = "auto";
HI.Kind = index::SymbolKind::TypeAlias;
- HI.Definition = "struct Bar";
+ HI.Definition = "Bar";
HI.Documentation = "auto function return with trailing type";
}},
{
[](HoverInfo &HI) {
HI.Name = "decltype";
HI.Kind = index::SymbolKind::TypeAlias;
- HI.Definition = "struct Bar";
+ HI.Definition = "Bar";
HI.Documentation = "trailing return type";
}},
{
[](HoverInfo &HI) {
HI.Name = "auto";
HI.Kind = index::SymbolKind::TypeAlias;
- HI.Definition = "struct Bar";
+ HI.Definition = "Bar";
HI.Documentation = "auto in function return";
}},
{
[](HoverInfo &HI) {
HI.Name = "auto";
HI.Kind = index::SymbolKind::TypeAlias;
- HI.Definition = "struct Bar";
+ HI.Definition = "Bar";
HI.Documentation = "auto& in function return";
}},
{
[](HoverInfo &HI) {
HI.Name = "auto";
HI.Kind = index::SymbolKind::TypeAlias;
- HI.Definition = "struct Bar";
+ HI.Definition = "Bar";
HI.Documentation = "auto* in function return";
}},
{
[](HoverInfo &HI) {
HI.Name = "auto";
HI.Kind = index::SymbolKind::TypeAlias;
- HI.Definition = "struct Bar";
+ HI.Definition = "Bar";
HI.Documentation = "const auto& in function return";
}},
{
[](HoverInfo &HI) {
HI.Name = "decltype";
HI.Kind = index::SymbolKind::TypeAlias;
- HI.Definition = "struct Bar";
+ HI.Definition = "Bar";
HI.Documentation = "decltype(auto) in function return";
}},
{
[](HoverInfo &HI) {
HI.Name = "decltype";
HI.Kind = index::SymbolKind::TypeAlias;
- HI.Definition = "struct Bar";
+ HI.Definition = "Bar";
HI.Documentation =
"decltype of function with trailing return type.";
}},
class X12 : public CopyableAlias<float> {
X12(const X12 &other) {}
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
- // CHECK-FIXES: X12(const X12 &other) {}
};
template <typename T>
class X15 : public CopyableAlias2 {
X15(const X15 &other) {}
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling a base constructor
- // CHECK-FIXES: X15(const X15 &other) {}
+ // CHECK-FIXES: X15(const X15 &other) : Copyable5(other) {}
};
class X16 : public NonCopyable {
template <class T>
void f_tmpl() {
std::shared_ptr<T> P1{new T[10]};
+ // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: shared pointer to non-array is initialized with array [bugprone-shared-ptr-array-mismatch]
+ // CHECK-FIXES: std::shared_ptr<T[]> P1{new T[10]};
}
void f5() {
void test() {
S a, b;
std::memcmp(&a, &b, sizeof(S));
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'inner_padding::S' which does not have a unique object representation; consider comparing the members of the object manually
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'S' which does not have a unique object representation; consider comparing the members of the object manually
}
} // namespace inner_padding
void f(C &c1, C &c2) {
if (!std::memcmp(&c1, &c2, sizeof(C))) {
- // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: comparing object representation of non-standard-layout type 'sei_cert_example_oop57_cpp::C'; consider using a comparison operator instead
+ // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: comparing object representation of non-standard-layout type 'C'; consider using a comparison operator instead
}
}
} // namespace sei_cert_example_oop57_cpp
void test() {
S a, b;
std::memcmp(&a, &b, sizeof(S));
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'inner_padding_64bit_only::S' which does not have a unique object representation; consider comparing the members of the object manually
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'S' which does not have a unique object representation; consider comparing the members of the object manually
}
} // namespace inner_padding_64bit_only
void testDerived() {
Derived a, b;
std::memcmp(&a, &b, sizeof(Base));
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'padding_in_base::Derived' which does not have a unique object representation; consider comparing the members of the object manually
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'Derived' which does not have a unique object representation; consider comparing the members of the object manually
std::memcmp(&a, &b, sizeof(Derived));
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'padding_in_base::Derived' which does not have a unique object representation; consider comparing the members of the object manually
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'Derived' which does not have a unique object representation; consider comparing the members of the object manually
}
void testDerived2() {
Derived2 a, b;
std::memcmp(&a, &b, sizeof(Base));
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'padding_in_base::Derived2' which does not have a unique object representation; consider comparing the members of the object manually
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'Derived2' which does not have a unique object representation; consider comparing the members of the object manually
std::memcmp(&a, &b, sizeof(Derived2));
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'padding_in_base::Derived2' which does not have a unique object representation; consider comparing the members of the object manually
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'Derived2' which does not have a unique object representation; consider comparing the members of the object manually
}
} // namespace padding_in_base
void test() {
C a, b;
std::memcmp(&a, &b, sizeof(C));
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of non-standard-layout type 'non_standard_layout::C'; consider using a comparison operator instead
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of non-standard-layout type 'C'; consider using a comparison operator instead
}
} // namespace non_standard_layout
void test() {
S a, b;
std::memcmp(&a, &b, sizeof(S));
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'empty_struct::S' which does not have a unique object representation; consider comparing the members of the object manually
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'S' which does not have a unique object representation; consider comparing the members of the object manually
}
} // namespace empty_struct
void test() {
S a, b;
std::memcmp(&a, &b, sizeof(S));
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'empty_field::S' which does not have a unique object representation; consider comparing the members of the object manually
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'S' which does not have a unique object representation; consider comparing the members of the object manually
}
} // namespace empty_field
void test() {
S a, b;
std::memcmp(&a, &b, sizeof(S));
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'no_unique_address_attribute::multiple_empties_same_type::S' which does not have a unique object representation; consider comparing the members of the object manually
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'S' which does not have a unique object representation; consider comparing the members of the object manually
}
} // namespace multiple_empties_same_type
void test() {
S a, b;
std::memcmp(&a, &b, sizeof(S));
- // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'alignment::S' which does not have a unique object representation; consider comparing the members of the object manually
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: comparing object representation of type 'S' which does not have a unique object representation; consider comparing the members of the object manually
}
} // namespace alignment
};
const Strukt p6() {}
- // CHECK-MESSAGES: [[@LINE-1]]:3: warning: return type 'const Clazz::Strukt' i
+ // CHECK-MESSAGES: [[@LINE-1]]:3: warning: return type 'const Strukt' i
// CHECK-FIXES: Strukt p6() {}
// No warning is emitted here, because this is only the declaration. The
// CHECK-FIXES: static int p8() {}
static const Strukt p9() {}
- // CHECK-MESSAGES: [[@LINE-1]]:3: warning: return type 'const Clazz::Strukt' i
+ // CHECK-MESSAGES: [[@LINE-1]]:3: warning: return type 'const Strukt' i
// CHECK-FIXES: static Strukt p9() {}
int n0() const { return 0; }
"namespace e {\n"
"class D : public a::Base<D> {\n"
" private:\n"
- " friend class Base<D>;\n"
+ " friend class a::Base<D>;\n"
" void priv() {}\n"
" a::Base b;\n"
"};\n"
self.assertIsNotNone(fields[1].translation_unit)
self.assertEqual(fields[1].spelling, 'b')
self.assertFalse(fields[1].type.is_const_qualified())
- self.assertEqual(fields[1].type.kind, TypeKind.TYPEDEF)
+ self.assertEqual(fields[1].type.kind, TypeKind.ELABORATED)
self.assertEqual(fields[1].type.get_canonical().kind, TypeKind.INT)
self.assertEqual(fields[1].type.get_declaration().spelling, 'I')
self.assertEqual(fields[1].type.get_typedef_name(), 'I')
bool typesAreBlockPointerCompatible(QualType, QualType);
bool isObjCIdType(QualType T) const {
+ if (const auto *ET = dyn_cast<ElaboratedType>(T))
+ T = ET->getNamedType();
return T == getObjCIdType();
}
bool isObjCClassType(QualType T) const {
+ if (const auto *ET = dyn_cast<ElaboratedType>(T))
+ T = ET->getNamedType();
return T == getObjCClassType();
}
bool isObjCSelType(QualType T) const {
+ if (const auto *ET = dyn_cast<ElaboratedType>(T))
+ T = ET->getNamedType();
return T == getObjCSelType();
}
ElaboratedTypeBits.HasOwnedTagDecl = true;
*getTrailingObjects<TagDecl *>() = OwnedTagDecl;
}
- assert(!(Keyword == ETK_None && NNS == nullptr) &&
- "ElaboratedType cannot have elaborated type keyword "
- "and name qualifier both null.");
}
public:
unsigned size = sizeof(LocalData);
unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
size = llvm::alignTo(size, extraAlign);
- return reinterpret_cast<char*>(Base::Data) + size;
+ return reinterpret_cast<char *>(Base::Data) + size;
}
void *getNonLocalData() const {
ElaboratedLocInfo> {
public:
SourceLocation getElaboratedKeywordLoc() const {
- return this->getLocalData()->ElaboratedKWLoc;
+ return !isEmpty() ? getLocalData()->ElaboratedKWLoc : SourceLocation();
}
void setElaboratedKeywordLoc(SourceLocation Loc) {
- this->getLocalData()->ElaboratedKWLoc = Loc;
+ if (isEmpty()) {
+ assert(Loc.isInvalid());
+ return;
+ }
+ getLocalData()->ElaboratedKWLoc = Loc;
}
NestedNameSpecifierLoc getQualifierLoc() const {
- return NestedNameSpecifierLoc(getTypePtr()->getQualifier(),
- getLocalData()->QualifierData);
+ return !isEmpty() ? NestedNameSpecifierLoc(getTypePtr()->getQualifier(),
+ getLocalData()->QualifierData)
+ : NestedNameSpecifierLoc();
}
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc) {
- assert(QualifierLoc.getNestedNameSpecifier()
- == getTypePtr()->getQualifier() &&
+ assert(QualifierLoc.getNestedNameSpecifier() ==
+ getTypePtr()->getQualifier() &&
"Inconsistent nested-name-specifier pointer");
+ if (isEmpty()) {
+ assert(!QualifierLoc.hasQualifier());
+ return;
+ }
getLocalData()->QualifierData = QualifierLoc.getOpaqueData();
}
void initializeLocal(ASTContext &Context, SourceLocation Loc);
- TypeLoc getNamedTypeLoc() const {
- return getInnerTypeLoc();
+ TypeLoc getNamedTypeLoc() const { return getInnerTypeLoc(); }
+
+ QualType getInnerType() const { return getTypePtr()->getNamedType(); }
+
+ bool isEmpty() const {
+ return getTypePtr()->getKeyword() == ElaboratedTypeKeyword::ETK_None &&
+ !getTypePtr()->getQualifier();
}
- QualType getInnerType() const {
- return getTypePtr()->getNamedType();
+ unsigned getLocalDataAlignment() const {
+ // FIXME: We want to return 1 here in the empty case, but
+ // there are bugs in how alignment is handled in TypeLocs
+ // that prevent this from working.
+ return ConcreteTypeLoc::getLocalDataAlignment();
+ }
+
+ unsigned getLocalDataSize() const {
+ return !isEmpty() ? ConcreteTypeLoc::getLocalDataSize() : 0;
}
void copy(ElaboratedTypeLoc Loc) {
if (LParenAdded)
PropertyString += ')';
QualType RT = Getter->getReturnType();
- if (!isa<TypedefType>(RT)) {
+ if (!RT->getAs<TypedefType>()) {
// strip off any ARC lifetime qualifier.
QualType CanResultTy = Context.getCanonicalType(RT);
if (CanResultTy.getQualifiers().hasObjCLifetime()) {
// Also, typedef-of-pointer-to-incomplete-struct is something that we assume
// is not an innter pointer type.
QualType OrigT = T;
- while (const TypedefType *TD = dyn_cast<TypedefType>(T.getTypePtr()))
+ while (const auto *TD = T->getAs<TypedefType>())
T = TD->getDecl()->getUnderlyingType();
if (OrigT == T || !T->isPointerType())
return true;
if (!Ty->isPointerType())
return false;
- while (const TypedefType *TD = dyn_cast<TypedefType>(Ty.getTypePtr()))
- Ty = TD->getDecl()->getUnderlyingType();
-
// Is the type void*?
const PointerType* PT = Ty->castAs<PointerType>();
if (PT->getPointeeType().getUnqualifiedType()->isVoidType())
/// 'l' or 'L' , but not always. For typedefs, we need to use
/// 'i' or 'I' instead if encoding a struct field, or a pointer!
void ASTContext::getLegacyIntegralTypeEncoding (QualType &PointeeTy) const {
- if (isa<TypedefType>(PointeeTy.getTypePtr())) {
+ if (PointeeTy->getAs<TypedefType>()) {
if (const auto *BT = PointeeTy->getAs<BuiltinType>()) {
if (BT->getKind() == BuiltinType::ULong && getIntWidth(PointeeTy) == 32)
PointeeTy = UnsignedIntTy;
// pointee gets emitted _before_ the '^'. The read-only qualifier of
// the pointer itself gets ignored, _unless_ we are looking at a typedef!
// Also, do not emit the 'r' for anything but the outermost type!
- if (isa<TypedefType>(T.getTypePtr())) {
+ if (T->getAs<TypedefType>()) {
if (Options.IsOutermostType() && T.isConstQualified()) {
isReadOnly = true;
S += 'r';
: FromType.getAsString(Policy);
std::string ToTypeStr = ToType.isNull() ? "(no argument)"
: ToType.getAsString(Policy);
- // Switch to canonical typename if it is better.
+ // Print without ElaboratedType sugar if it is better.
// TODO: merge this with other aka printing above.
if (FromTypeStr == ToTypeStr) {
+ const auto *FromElTy = dyn_cast<ElaboratedType>(FromType),
+ *ToElTy = dyn_cast<ElaboratedType>(ToType);
+ if (FromElTy || ToElTy) {
+ std::string FromNamedTypeStr =
+ FromElTy ? FromElTy->getNamedType().getAsString(Policy)
+ : FromTypeStr;
+ std::string ToNamedTypeStr =
+ ToElTy ? ToElTy->getNamedType().getAsString(Policy) : ToTypeStr;
+ if (FromNamedTypeStr != ToNamedTypeStr) {
+ FromTypeStr = FromNamedTypeStr;
+ ToTypeStr = ToNamedTypeStr;
+ goto PrintTypes;
+ }
+ }
+ // Switch to canonical typename if it is better.
std::string FromCanTypeStr =
FromType.getCanonicalType().getAsString(Policy);
std::string ToCanTypeStr = ToType.getCanonicalType().getAsString(Policy);
}
}
+ PrintTypes:
if (PrintTree) OS << '[';
OS << (FromDefault ? "(default) " : "");
Bold();
return getMemberLocation();
if (const auto *TSInfo = Initializee.get<TypeSourceInfo *>())
- return TSInfo->getTypeLoc().getLocalSourceRange().getBegin();
+ return TSInfo->getTypeLoc().getBeginLoc();
return {};
}
// CXXPseudoDestructorExpr
PseudoDestructorTypeStorage::PseudoDestructorTypeStorage(TypeSourceInfo *Info)
: Type(Info) {
- Location = Info->getTypeLoc().getLocalSourceRange().getBegin();
+ Location = Info->getTypeLoc().getBeginLoc();
}
CXXPseudoDestructorExpr::CXXPseudoDestructorExpr(
SourceLocation CXXPseudoDestructorExpr::getEndLoc() const {
SourceLocation End = DestroyedType.getLocation();
if (TypeSourceInfo *TInfo = DestroyedType.getTypeSourceInfo())
- End = TInfo->getTypeLoc().getLocalSourceRange().getEnd();
+ End = TInfo->getTypeLoc().getSourceRange().getEnd();
return End;
}
bool FormatSpecifier::namedTypeToLengthModifier(QualType QT,
LengthModifier &LM) {
- assert(isa<TypedefType>(QT) && "Expected a TypedefType");
- const TypedefNameDecl *Typedef = cast<TypedefType>(QT)->getDecl();
-
- for (;;) {
+ for (/**/; const auto *TT = QT->getAs<TypedefType>();
+ QT = TT->getDecl()->getUnderlyingType()) {
+ const TypedefNameDecl *Typedef = TT->getDecl();
const IdentifierInfo *Identifier = Typedef->getIdentifier();
if (Identifier->getName() == "size_t") {
LM.setKind(LengthModifier::AsSizeT);
LM.setKind(LengthModifier::AsPtrDiff);
return true;
}
-
- QualType T = Typedef->getUnderlyingType();
- if (!isa<TypedefType>(T))
- break;
-
- Typedef = cast<TypedefType>(T)->getDecl();
}
return false;
}
}
// Handle size_t, ptrdiff_t, etc. that have dedicated length modifiers in C99.
- if (isa<TypedefType>(QT) && (LangOpt.C99 || LangOpt.CPlusPlus11))
+ if (LangOpt.C99 || LangOpt.CPlusPlus11)
namedTypeToLengthModifier(QT, LM);
// If fixing the length modifier was enough, we might be done.
// Set conversion specifier and disable any flags which do not apply to it.
// Let typedefs to char fall through to int, as %c is silly for uint8_t.
- if (!isa<TypedefType>(QT) && QT->isCharType()) {
+ if (!QT->getAs<TypedefType>() && QT->isCharType()) {
CS.setKind(ConversionSpecifier::cArg);
LM.setKind(LengthModifier::None);
Precision.setHowSpecified(OptionalAmount::NotSpecified);
// Test for Floating type first as LongDouble can pass isUnsignedIntegerType
else if (QT->isRealFloatingType()) {
CS.setKind(ConversionSpecifier::fArg);
- }
- else if (QT->isSignedIntegerType()) {
+ } else if (QT->isSignedIntegerType()) {
CS.setKind(ConversionSpecifier::dArg);
HasAlternativeForm = false;
- }
- else if (QT->isUnsignedIntegerType()) {
+ } else if (QT->isUnsignedIntegerType()) {
CS.setKind(ConversionSpecifier::uArg);
HasAlternativeForm = false;
HasPlusPrefix = false;
return QT;
}
- // We don't consider the alias introduced by `using a::X` as a new type.
- // The qualified name is still a::X.
- if (isa<UsingType>(QT.getTypePtr())) {
- return getFullyQualifiedType(QT.getSingleStepDesugaredType(Ctx), Ctx,
- WithGlobalNsPrefix);
- }
-
// Remove the part of the type related to the type being a template
// parameter (we won't report it as part of the 'type name' and it
// is actually make the code below to be more complex (to handle
assert(!QT.hasLocalQualifiers());
Keyword = ETypeInput->getKeyword();
}
+
+ // We don't consider the alias introduced by `using a::X` as a new type.
+ // The qualified name is still a::X.
+ if (const auto *UT = QT->getAs<UsingType>()) {
+ return getFullyQualifiedType(UT->getUnderlyingType(), Ctx,
+ WithGlobalNsPrefix);
+ }
+
// Create a nested name specifier if needed.
Prefix = createNestedNameSpecifierForScopeOf(Ctx, QT.getTypePtr(),
true /*FullyQualified*/,
}
// Handle size_t, ptrdiff_t, etc. that have dedicated length modifiers in C99.
- if (isa<TypedefType>(PT) && (LangOpt.C99 || LangOpt.CPlusPlus11))
+ if (LangOpt.C99 || LangOpt.CPlusPlus11)
namedTypeToLengthModifier(PT, LM);
// If fixing the length modifier was enough, we are done.
}
bool Type::isObjCNSObjectType() const {
- const Type *cur = this;
- while (true) {
- if (const auto *typedefType = dyn_cast<TypedefType>(cur))
- return typedefType->getDecl()->hasAttr<ObjCNSObjectAttr>();
-
- // Single-step desugar until we run out of sugar.
- QualType next = cur->getLocallyUnqualifiedSingleStepDesugaredType();
- if (next.getTypePtr() == cur) return false;
- cur = next.getTypePtr();
- }
+ if (const auto *typedefType = getAs<TypedefType>())
+ return typedefType->getDecl()->hasAttr<ObjCNSObjectAttr>();
+ return false;
}
bool Type::isObjCIndependentClassType() const {
- if (const auto *typedefType = dyn_cast<TypedefType>(this))
+ if (const auto *typedefType = getAs<TypedefType>())
return typedefType->getDecl()->hasAttr<ObjCIndependentClassAttr>();
return false;
}
while (true) {
switch (Cur.getTypeLocClass()) {
case Elaborated:
- LeftMost = Cur;
- break;
+ if (Cur.getLocalSourceRange().getBegin().isValid()) {
+ LeftMost = Cur;
+ break;
+ }
+ Cur = Cur.getNextTypeLoc();
+ if (Cur.isNull())
+ break;
+ continue;
case FunctionProto:
if (Cur.castAs<FunctionProtoTypeLoc>().getTypePtr()
->hasTrailingReturn()) {
void ElaboratedTypeLoc::initializeLocal(ASTContext &Context,
SourceLocation Loc) {
+ if (isEmpty())
+ return;
setElaboratedKeywordLoc(Loc);
NestedNameSpecifierLocBuilder Builder;
Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
/// has a typedef with a given name @c Name.
static bool hasTypedefNamed(QualType QT,
StringRef Name) {
- while (auto *T = dyn_cast<TypedefType>(QT)) {
+ while (auto *T = QT->getAs<TypedefType>()) {
const auto &Context = T->getDecl()->getASTContext();
if (T->getDecl()->getIdentifier() == &Context.Idents.get(Name))
return true;
// Set `align` attribute if any.
const auto *AVAttr = PVD->getAttr<AlignValueAttr>();
if (!AVAttr)
- if (const auto *TOTy = dyn_cast<TypedefType>(OTy))
+ if (const auto *TOTy = OTy->getAs<TypedefType>())
AVAttr = TOTy->getDecl()->getAttr<AlignValueAttr>();
if (AVAttr && !SanOpts.has(SanitizerKind::Alignment)) {
// If alignment-assumption sanitizer is enabled, we do *not* add
if (VD->getType()->isReferenceType()) {
if (const auto *TTy =
- dyn_cast<TypedefType>(VD->getType().getNonReferenceType()))
+ VD->getType().getNonReferenceType()->getAs<TypedefType>())
AVAttr = TTy->getDecl()->getAttr<AlignValueAttr>();
} else {
// Assumptions for function parameters are emitted at the start of the
}
if (!AVAttr)
- if (const auto *TTy =
- dyn_cast<TypedefType>(E->getType()))
+ if (const auto *TTy = E->getType()->getAs<TypedefType>())
AVAttr = TTy->getDecl()->getAttr<AlignValueAttr>();
if (!AVAttr)
case Type::ConstantMatrix:
case Type::Record:
case Type::Enum:
- case Type::Elaborated:
case Type::Using:
case Type::TemplateSpecialization:
case Type::ObjCTypeParam:
case Type::BitInt:
llvm_unreachable("type class is never variably-modified!");
+ case Type::Elaborated:
+ type = cast<ElaboratedType>(ty)->getNamedType();
+ break;
+
case Type::Adjusted:
type = cast<AdjustedType>(ty)->getAdjustedType();
break;
// Get image and pipe access qualifier:
if (ty->isImageType() || ty->isPipeType()) {
const Decl *PDecl = parm;
- if (auto *TD = dyn_cast<TypedefType>(ty))
+ if (const auto *TD = ty->getAs<TypedefType>())
PDecl = TD->getDecl();
const OpenCLAccessAttr *A = PDecl->getAttr<OpenCLAccessAttr>();
if (A && A->isWriteOnly())
if (D->isBitField())
IvarT = GetGroupRecordTypeForObjCIvarBitfield(D);
- if (!isa<TypedefType>(IvarT) && IvarT->isRecordType()) {
+ if (!IvarT->getAs<TypedefType>() && IvarT->isRecordType()) {
RecordDecl *RD = IvarT->castAs<RecordType>()->getDecl();
RD = RD->getDefinition();
if (RD && !RD->getDeclName().getAsIdentifierInfo()) {
/// It handles elaborated types, as well as enum types in the process.
bool RewriteModernObjC::RewriteObjCFieldDeclType(QualType &Type,
std::string &Result) {
- if (isa<TypedefType>(Type)) {
+ if (Type->getAs<TypedefType>()) {
Result += "\t";
return false;
}
void RewriteModernObjC::RewriteLocallyDefinedNamedAggregates(FieldDecl *fieldDecl,
std::string &Result) {
QualType Type = fieldDecl->getType();
- if (isa<TypedefType>(Type))
+ if (Type->getAs<TypedefType>())
return;
if (Type->isArrayType())
Type = Context->getBaseElementType(Type);
if (D->isBitField())
IvarT = GetGroupRecordTypeForObjCIvarBitfield(D);
- if (!isa<TypedefType>(IvarT) && IvarT->isRecordType()) {
+ if (!IvarT->getAs<TypedefType>() && IvarT->isRecordType()) {
RecordDecl *RD = IvarT->castAs<RecordType>()->getDecl();
RD = RD->getDefinition();
if (RD && !RD->getDeclName().getAsIdentifierInfo()) {
// We extract the name from the typedef because we don't want to show
// the underlying type in the diagnostic.
StringRef Name;
- if (const TypedefType *TypedefTy = dyn_cast<TypedefType>(ExprTy))
+ if (const auto *TypedefTy = ExprTy->getAs<TypedefType>())
Name = TypedefTy->getDecl()->getName();
else
Name = CastTyName;
while (TInfo) {
TypeLoc TL = TInfo->getTypeLoc();
// Look through typedefs.
- if (TypedefTypeLoc TTL = TL.getAs<TypedefTypeLoc>()) {
+ if (TypedefTypeLoc TTL = TL.getAsAdjusted<TypedefTypeLoc>()) {
const TypedefNameDecl *TDL = TTL.getTypedefNameDecl();
TInfo = TDL->getTypeSourceInfo();
continue;
while (true) {
// Look through typedefs.
if (!SuppressBlock) {
- if (TypedefTypeLoc TypedefTL = TL.getAs<TypedefTypeLoc>()) {
+ if (TypedefTypeLoc TypedefTL = TL.getAsAdjusted<TypedefTypeLoc>()) {
if (TypeSourceInfo *InnerTSInfo =
TypedefTL.getTypedefNameDecl()->getTypeSourceInfo()) {
TL = InnerTSInfo->getTypeLoc().getUnqualifiedLoc();
return S.CreateParsedType(T, Builder.getTypeSourceInfo(Context, T));
}
+/// Build a ParsedType for a simple-type-specifier with a nested-name-specifier.
+static ParsedType buildNamedType(Sema &S, const CXXScopeSpec *SS, QualType T,
+ SourceLocation NameLoc,
+ bool WantNontrivialTypeSourceInfo = true) {
+ switch (T->getTypeClass()) {
+ case Type::DeducedTemplateSpecialization:
+ case Type::Enum:
+ case Type::InjectedClassName:
+ case Type::Record:
+ case Type::Typedef:
+ case Type::UnresolvedUsing:
+ case Type::Using:
+ break;
+ // These can never be qualified so an ElaboratedType node
+ // would carry no additional meaning.
+ case Type::ObjCInterface:
+ case Type::ObjCTypeParam:
+ case Type::TemplateTypeParm:
+ return ParsedType::make(T);
+ default:
+ llvm_unreachable("Unexpected Type Class");
+ }
+
+ if (!SS || SS->isEmpty())
+ return ParsedType::make(
+ S.Context.getElaboratedType(ETK_None, nullptr, T, nullptr));
+
+ QualType ElTy = S.getElaboratedType(ETK_None, *SS, T);
+ if (!WantNontrivialTypeSourceInfo)
+ return ParsedType::make(ElTy);
+
+ TypeLocBuilder Builder;
+ Builder.pushTypeSpec(T).setNameLoc(NameLoc);
+ ElaboratedTypeLoc ElabTL = Builder.push<ElaboratedTypeLoc>(ElTy);
+ ElabTL.setElaboratedKeywordLoc(SourceLocation());
+ ElabTL.setQualifierLoc(SS->getWithLocInContext(S.Context));
+ return S.CreateParsedType(ElTy, Builder.getTypeSourceInfo(S.Context, ElTy));
+}
+
/// If the identifier refers to a type name within this scope,
/// return the declaration of that type.
///
} else if (auto *UD = dyn_cast<UnresolvedUsingIfExistsDecl>(IIDecl)) {
(void)DiagnoseUseOfDecl(UD, NameLoc);
// Recover with 'int'
- T = Context.IntTy;
- FoundUsingShadow = nullptr;
+ return ParsedType::make(Context.IntTy);
} else if (AllowDeducedTemplate) {
if (auto *TD = getAsTypeTemplateDecl(IIDecl)) {
assert(!FoundUsingShadow || FoundUsingShadow->getTargetDecl() == TD);
if (FoundUsingShadow)
T = Context.getUsingType(FoundUsingShadow, T);
- // NOTE: avoid constructing an ElaboratedType(Loc) if this is a
- // constructor or destructor name (in such a case, the scope specifier
- // will be attached to the enclosing Expr or Decl node).
- if (SS && SS->isNotEmpty() && !IsCtorOrDtorName &&
- !isa<ObjCInterfaceDecl, UnresolvedUsingIfExistsDecl>(IIDecl)) {
- if (WantNontrivialTypeSourceInfo) {
- // Construct a type with type-source information.
- TypeLocBuilder Builder;
- Builder.pushTypeSpec(T).setNameLoc(NameLoc);
-
- T = getElaboratedType(ETK_None, *SS, T);
- ElaboratedTypeLoc ElabTL = Builder.push<ElaboratedTypeLoc>(T);
- ElabTL.setElaboratedKeywordLoc(SourceLocation());
- ElabTL.setQualifierLoc(SS->getWithLocInContext(Context));
- return CreateParsedType(T, Builder.getTypeSourceInfo(Context, T));
- } else {
- T = getElaboratedType(ETK_None, *SS, T);
- }
- }
-
- return ParsedType::make(T);
+ return buildNamedType(*this, SS, T, NameLoc, WantNontrivialTypeSourceInfo);
}
// Builds a fake NNS for the given decl context.
QualType T = Context.getTypeDeclType(Type);
if (const auto *USD = dyn_cast<UsingShadowDecl>(Found))
T = Context.getUsingType(USD, T);
-
- if (SS.isEmpty()) // No elaborated type, trivial location info
- return ParsedType::make(T);
-
- TypeLocBuilder Builder;
- Builder.pushTypeSpec(T).setNameLoc(NameLoc);
- T = getElaboratedType(ETK_None, SS, T);
- ElaboratedTypeLoc ElabTL = Builder.push<ElaboratedTypeLoc>(T);
- ElabTL.setElaboratedKeywordLoc(SourceLocation());
- ElabTL.setQualifierLoc(SS.getWithLocInContext(Context));
- return CreateParsedType(T, Builder.getTypeSourceInfo(Context, T));
+ return buildNamedType(*this, &SS, T, NameLoc);
};
NamedDecl *FirstDecl = (*Result.begin())->getUnderlyingDecl();
}
if (BaseType.isNull()) {
- BaseType = Context.getTypeDeclType(TyD);
+ BaseType = getElaboratedType(ETK_None, SS, Context.getTypeDeclType(TyD));
MarkAnyDeclReferenced(TyD->getLocation(), TyD, /*OdrUse=*/false);
- if (SS.isSet()) {
- BaseType = Context.getElaboratedType(ETK_None, SS.getScopeRep(),
- BaseType);
- TInfo = Context.CreateTypeSourceInfo(BaseType);
- ElaboratedTypeLoc TL = TInfo->getTypeLoc().castAs<ElaboratedTypeLoc>();
- TL.getNamedTypeLoc().castAs<TypeSpecTypeLoc>().setNameLoc(IdLoc);
- TL.setElaboratedKeywordLoc(SourceLocation());
- TL.setQualifierLoc(SS.getWithLocInContext(Context));
- }
+ TInfo = Context.CreateTypeSourceInfo(BaseType);
+ ElaboratedTypeLoc TL = TInfo->getTypeLoc().castAs<ElaboratedTypeLoc>();
+ TL.getNamedTypeLoc().castAs<TypeSpecTypeLoc>().setNameLoc(IdLoc);
+ TL.setElaboratedKeywordLoc(SourceLocation());
+ TL.setQualifierLoc(SS.getWithLocInContext(Context));
}
}
MemInitResult
Sema::BuildDelegatingInitializer(TypeSourceInfo *TInfo, Expr *Init,
CXXRecordDecl *ClassDecl) {
- SourceLocation NameLoc = TInfo->getTypeLoc().getLocalSourceRange().getBegin();
+ SourceLocation NameLoc = TInfo->getTypeLoc().getSourceRange().getBegin();
if (!LangOpts.CPlusPlus11)
return Diag(NameLoc, diag::err_delegating_ctor)
- << TInfo->getTypeLoc().getLocalSourceRange();
+ << TInfo->getTypeLoc().getSourceRange();
Diag(NameLoc, diag::warn_cxx98_compat_delegating_ctor);
bool InitList = true;
Sema::BuildBaseInitializer(QualType BaseType, TypeSourceInfo *BaseTInfo,
Expr *Init, CXXRecordDecl *ClassDecl,
SourceLocation EllipsisLoc) {
- SourceLocation BaseLoc
- = BaseTInfo->getTypeLoc().getLocalSourceRange().getBegin();
+ SourceLocation BaseLoc = BaseTInfo->getTypeLoc().getBeginLoc();
if (!BaseType->isDependentType() && !BaseType->isRecordType())
return Diag(BaseLoc, diag::err_base_init_does_not_name_class)
- << BaseType << BaseTInfo->getTypeLoc().getLocalSourceRange();
+ << BaseType << BaseTInfo->getTypeLoc().getSourceRange();
// C++ [class.base.init]p2:
// [...] Unless the mem-initializer-id names a nonstatic data
Dependent = true;
else
return Diag(BaseLoc, diag::err_not_direct_base_or_virtual)
- << BaseType << Context.getTypeDeclType(ClassDecl)
- << BaseTInfo->getTypeLoc().getLocalSourceRange();
+ << BaseType << Context.getTypeDeclType(ClassDecl)
+ << BaseTInfo->getTypeLoc().getSourceRange();
}
}
bool AcceptableReturnType = false;
bool MightInstantiateToSpecialization = false;
if (auto RetTST =
- TSI->getTypeLoc().getAs<TemplateSpecializationTypeLoc>()) {
+ TSI->getTypeLoc().getAsAdjusted<TemplateSpecializationTypeLoc>()) {
TemplateName SpecifiedName = RetTST.getTypePtr()->getTemplateName();
bool TemplateMatches =
Context.hasSameTemplateName(SpecifiedName, GuidedTemplate);
assert(TSInfo && "NULL TypeSourceInfo for friend type declaration");
QualType T = TSInfo->getType();
- SourceRange TypeRange = TSInfo->getTypeLoc().getLocalSourceRange();
+ SourceRange TypeRange = TSInfo->getTypeLoc().getSourceRange();
// C++03 [class.friend]p2:
// An elaborated-type-specifier shall be used in a friend declaration
case Type::ConstantMatrix:
case Type::Record:
case Type::Enum:
- case Type::Elaborated:
case Type::TemplateSpecialization:
case Type::ObjCObject:
case Type::ObjCInterface:
case Type::Pipe:
case Type::BitInt:
llvm_unreachable("type class is never variably-modified!");
+ case Type::Elaborated:
+ T = cast<ElaboratedType>(Ty)->getNamedType();
+ break;
case Type::Adjusted:
T = cast<AdjustedType>(Ty)->getOriginalType();
break;
if (IsAcceptableResult(Type)) {
QualType T = Context.getTypeDeclType(Type);
MarkAnyDeclReferenced(Type->getLocation(), Type, /*OdrUse=*/false);
- return CreateParsedType(T,
+ return CreateParsedType(Context.getElaboratedType(ETK_None, nullptr, T),
Context.getTrivialTypeSourceInfo(T, NameLoc));
}
}
// designated by the pseudo-destructor-name shall be the same type.
if (DestructedTypeInfo) {
QualType DestructedType = DestructedTypeInfo->getType();
- SourceLocation DestructedTypeStart
- = DestructedTypeInfo->getTypeLoc().getLocalSourceRange().getBegin();
+ SourceLocation DestructedTypeStart =
+ DestructedTypeInfo->getTypeLoc().getBeginLoc();
if (!DestructedType->isDependentType() && !ObjectType->isDependentType()) {
if (!Context.hasSameUnqualifiedType(DestructedType, ObjectType)) {
// Detect dot pseudo destructor calls on pointer objects, e.g.:
} else {
Diag(DestructedTypeStart, diag::err_pseudo_dtor_type_mismatch)
<< ObjectType << DestructedType << Base->getSourceRange()
- << DestructedTypeInfo->getTypeLoc().getLocalSourceRange();
+ << DestructedTypeInfo->getTypeLoc().getSourceRange();
// Recover by setting the destructed type to the object type.
DestructedType = ObjectType;
// type.
} else {
Diag(DestructedTypeStart, diag::err_arc_pseudo_dtor_inconstant_quals)
- << ObjectType << DestructedType << Base->getSourceRange()
- << DestructedTypeInfo->getTypeLoc().getLocalSourceRange();
+ << ObjectType << DestructedType << Base->getSourceRange()
+ << DestructedTypeInfo->getTypeLoc().getSourceRange();
}
// Recover by setting the destructed type to the object type.
if (!ScopeType->isDependentType() && !ObjectType->isDependentType() &&
!Context.hasSameUnqualifiedType(ScopeType, ObjectType)) {
- Diag(ScopeTypeInfo->getTypeLoc().getLocalSourceRange().getBegin(),
+ Diag(ScopeTypeInfo->getTypeLoc().getSourceRange().getBegin(),
diag::err_pseudo_dtor_type_mismatch)
- << ObjectType << ScopeType << Base->getSourceRange()
- << ScopeTypeInfo->getTypeLoc().getLocalSourceRange();
+ << ObjectType << ScopeType << Base->getSourceRange()
+ << ScopeTypeInfo->getTypeLoc().getSourceRange();
ScopeType = QualType();
ScopeTypeInfo = nullptr;
static ObjCBridgeRelatedAttr *ObjCBridgeRelatedAttrFromType(QualType T,
TypedefNameDecl *&TDNDecl) {
- while (const TypedefType *TD = dyn_cast<TypedefType>(T.getTypePtr())) {
+ while (const auto *TD = T->getAs<TypedefType>()) {
TDNDecl = TD->getDecl();
if (ObjCBridgeRelatedAttr *ObjCBAttr =
getObjCBridgeAttr<ObjCBridgeRelatedAttr>(TD))
bool &HadTheAttribute, bool warn) {
QualType T = castExpr->getType();
HadTheAttribute = false;
- while (const TypedefType *TD = dyn_cast<TypedefType>(T.getTypePtr())) {
+ while (const auto *TD = T->getAs<TypedefType>()) {
TypedefNameDecl *TDNDecl = TD->getDecl();
if (TB *ObjCBAttr = getObjCBridgeAttr<TB>(TD)) {
if (IdentifierInfo *Parm = ObjCBAttr->getBridgedType()) {
bool &HadTheAttribute, bool warn) {
QualType T = castType;
HadTheAttribute = false;
- while (const TypedefType *TD = dyn_cast<TypedefType>(T.getTypePtr())) {
+ while (const auto *TD = T->getAs<TypedefType>()) {
TypedefNameDecl *TDNDecl = TD->getDecl();
if (TB *ObjCBAttr = getObjCBridgeAttr<TB>(TD)) {
if (IdentifierInfo *Parm = ObjCBAttr->getBridgedType()) {
return CreateParsedType(T, TLB.getTypeSourceInfo(Context, T));
}
- QualType Result = CheckTemplateIdType(Template, TemplateIILoc, TemplateArgs);
- if (Result.isNull())
+ QualType SpecTy = CheckTemplateIdType(Template, TemplateIILoc, TemplateArgs);
+ if (SpecTy.isNull())
return true;
// Build type-source information.
TypeLocBuilder TLB;
- TemplateSpecializationTypeLoc SpecTL
- = TLB.push<TemplateSpecializationTypeLoc>(Result);
+ TemplateSpecializationTypeLoc SpecTL =
+ TLB.push<TemplateSpecializationTypeLoc>(SpecTy);
SpecTL.setTemplateKeywordLoc(TemplateKWLoc);
SpecTL.setTemplateNameLoc(TemplateIILoc);
SpecTL.setLAngleLoc(LAngleLoc);
for (unsigned i = 0, e = SpecTL.getNumArgs(); i != e; ++i)
SpecTL.setArgLocInfo(i, TemplateArgs[i].getLocInfo());
- // NOTE: avoid constructing an ElaboratedTypeLoc if this is a
- // constructor or destructor name (in such a case, the scope specifier
- // will be attached to the enclosing Decl or Expr node).
- if (SS.isNotEmpty() && !IsCtorOrDtorName) {
- // Create an elaborated-type-specifier containing the nested-name-specifier.
- Result = Context.getElaboratedType(ETK_None, SS.getScopeRep(), Result);
- ElaboratedTypeLoc ElabTL = TLB.push<ElaboratedTypeLoc>(Result);
- ElabTL.setElaboratedKeywordLoc(SourceLocation());
+ // Create an elaborated-type-specifier containing the nested-name-specifier.
+ QualType ElTy = getElaboratedType(
+ ETK_None, !IsCtorOrDtorName ? SS : CXXScopeSpec(), SpecTy);
+ ElaboratedTypeLoc ElabTL = TLB.push<ElaboratedTypeLoc>(ElTy);
+ ElabTL.setElaboratedKeywordLoc(SourceLocation());
+ if (!ElabTL.isEmpty())
ElabTL.setQualifierLoc(SS.getWithLocInContext(Context));
- }
-
- return CreateParsedType(Result, TLB.getTypeSourceInfo(Context, Result));
+ return CreateParsedType(ElTy, TLB.getTypeSourceInfo(Context, ElTy));
}
TypeResult Sema::ActOnTagTemplateIdType(TagUseKind TUK,
// in ClsType; hence we wrap ClsType into an ElaboratedType.
// NOTE: in particular, no wrap occurs if ClsType already is an
// Elaborated, DependentName, or DependentTemplateSpecialization.
- if (NNSPrefix && isa<TemplateSpecializationType>(NNS->getAsType()))
+ if (isa<TemplateSpecializationType>(NNS->getAsType()))
ClsType = Context.getElaboratedType(ETK_None, NNSPrefix, ClsType);
break;
}
}
}
void VisitElaboratedTypeLoc(ElaboratedTypeLoc TL) {
- ElaboratedTypeKeyword Keyword
- = TypeWithKeyword::getKeywordForTypeSpec(DS.getTypeSpecType());
if (DS.getTypeSpecType() == TST_typename) {
TypeSourceInfo *TInfo = nullptr;
Sema::GetTypeFromParser(DS.getRepAsType(), &TInfo);
- if (TInfo) {
- TL.copy(TInfo->getTypeLoc().castAs<ElaboratedTypeLoc>());
- return;
- }
+ if (TInfo)
+ if (auto ETL = TInfo->getTypeLoc().getAs<ElaboratedTypeLoc>()) {
+ TL.copy(ETL);
+ return;
+ }
}
- TL.setElaboratedKeywordLoc(Keyword != ETK_None
- ? DS.getTypeSpecTypeLoc()
- : SourceLocation());
+ const ElaboratedType *T = TL.getTypePtr();
+ TL.setElaboratedKeywordLoc(T->getKeyword() != ETK_None
+ ? DS.getTypeSpecTypeLoc()
+ : SourceLocation());
const CXXScopeSpec& SS = DS.getTypeSpecScope();
TL.setQualifierLoc(SS.getWithLocInContext(Context));
Visit(TL.getNextTypeLoc().getUnqualifiedLoc());
TagDecl *OwnedTagDecl) {
if (T.isNull())
return T;
- NestedNameSpecifier *NNS;
- if (SS.isValid())
- NNS = SS.getScopeRep();
- else {
- if (Keyword == ETK_None)
- return T;
- NNS = nullptr;
- }
- return Context.getElaboratedType(Keyword, NNS, T, OwnedTagDecl);
+ return Context.getElaboratedType(
+ Keyword, SS.isValid() ? SS.getScopeRep() : nullptr, T, OwnedTagDecl);
}
QualType Sema::BuildTypeofExprType(Expr *E) {
// Otherwise, make an elaborated type wrapping a non-dependent
// specialization.
QualType T =
- getDerived().RebuildTemplateSpecializationType(InstName, NameLoc, Args);
- if (T.isNull()) return QualType();
-
- if (Keyword == ETK_None && QualifierLoc.getNestedNameSpecifier() == nullptr)
- return T;
-
- return SemaRef.Context.getElaboratedType(Keyword,
- QualifierLoc.getNestedNameSpecifier(),
- T);
+ getDerived().RebuildTemplateSpecializationType(InstName, NameLoc, Args);
+ if (T.isNull())
+ return QualType();
+ return SemaRef.Context.getElaboratedType(
+ Keyword, QualifierLoc.getNestedNameSpecifier(), T);
}
/// Build a new typename type that refers to an identifier.
}
// If the nested-name-specifier is an invalid type def, don't emit an
// error because a previous error should have already been emitted.
- TypedefTypeLoc TTL = TL.getAs<TypedefTypeLoc>();
+ TypedefTypeLoc TTL = TL.getAsAdjusted<TypedefTypeLoc>();
if (!TTL || !TTL.getTypedefNameDecl()->isInvalidDecl()) {
SemaRef.Diag(TL.getBeginLoc(), diag::err_nested_name_spec_non_tag)
<< TL.getType() << SS.getRange();
// FIXME: 4 and 8 are sufficient at the moment, but it's pretty ugly to
// hardcode them.
if (LocalAlignment == 4) {
- if (NumBytesAtAlign8 == 0) {
+ if (!AtAlign8) {
NumBytesAtAlign4 += LocalSize;
} else {
unsigned Padding = NumBytesAtAlign4 % 8;
NumBytesAtAlign4 += LocalSize;
}
} else if (LocalAlignment == 8) {
- if (NumBytesAtAlign8 == 0) {
+ if (!AtAlign8) {
// We have not seen any 8-byte aligned element yet. We insert a padding
// only if the new Index is not 8-byte-aligned.
if ((Index - LocalSize) % 8 != 0) {
// Forget about any padding.
NumBytesAtAlign4 = 0;
- NumBytesAtAlign8 += LocalSize;
+ AtAlign8 = true;
} else {
assert(LocalSize == 0);
}
/// The inline buffer.
enum { BufferMaxAlignment = alignof(void *) };
alignas(BufferMaxAlignment) char InlineBuffer[InlineCapacity];
- unsigned NumBytesAtAlign4, NumBytesAtAlign8;
+ unsigned NumBytesAtAlign4;
+ bool AtAlign8;
public:
TypeLocBuilder()
: Buffer(InlineBuffer), Capacity(InlineCapacity), Index(InlineCapacity),
- NumBytesAtAlign4(0), NumBytesAtAlign8(0) {}
+ NumBytesAtAlign4(0), AtAlign8(false) {}
~TypeLocBuilder() {
if (Buffer != InlineBuffer)
LastTy = QualType();
#endif
Index = Capacity;
- NumBytesAtAlign4 = NumBytesAtAlign8 = 0;
+ NumBytesAtAlign4 = 0;
+ AtAlign8 = false;
}
/// Tell the TypeLocBuilder that the type it is storing has been
// Look through the typedefs.
while (const Type *T = Ty.getTypePtr()) {
- if (const auto *TT = dyn_cast<TypedefType>(T)) {
+ if (const auto *AT = dyn_cast<AttributedType>(T)) {
+ if (AT->getAttrKind() == attr::TypeNonNull)
+ return true;
+ Ty = AT->getModifiedType();
+ } else if (const auto *ET = dyn_cast<ElaboratedType>(T)) {
+ const auto *TT = dyn_cast<TypedefType>(ET->getNamedType());
+ if (!TT)
+ return false;
Ty = TT->getDecl()->getUnderlyingType();
// It is sufficient for any intermediate typedef
// to be classified const.
HasConst = HasConst || Ty.isConstQualified();
if (isNonnullType(Ty) && HasConst)
return true;
- } else if (const auto *AT = dyn_cast<AttributedType>(T)) {
- if (AT->getAttrKind() == attr::TypeNonNull)
- return true;
- Ty = AT->getModifiedType();
} else {
return false;
}
if (auto *T = dyn_cast<ObjCObjectPointerType>(Ty)) {
return T->getInterfaceDecl() &&
T->getInterfaceDecl()->getIdentifier() == NSStringII;
- } else if (auto *T = dyn_cast<TypedefType>(Ty)) {
+ } else if (auto *T = Ty->getAs<TypedefType>()) {
IdentifierInfo* II = T->getDecl()->getIdentifier();
return II == CFStringRefII || II == CFBooleanRefII || II == CFNullRefII;
}
AnalysisManager &AM,
BugReporter &BR) const {
// Currently this matches CoreFoundation opaque pointer typedefs.
- auto CSuspiciousNumberObjectExprM =
- expr(ignoringParenImpCasts(
- expr(hasType(
- typedefType(hasDeclaration(anyOf(
- typedefDecl(hasName("CFNumberRef")),
- typedefDecl(hasName("CFBooleanRef")))))))
+ auto CSuspiciousNumberObjectExprM = expr(ignoringParenImpCasts(
+ expr(hasType(elaboratedType(namesType(typedefType(
+ hasDeclaration(anyOf(typedefDecl(hasName("CFNumberRef")),
+ typedefDecl(hasName("CFBooleanRef")))))))))
.bind("c_object")));
// Currently this matches XNU kernel number-object pointers.
// The .bind here is in order to compose the error message more accurately.
auto ObjCSuspiciousScalarBooleanTypeM =
- qualType(typedefType(hasDeclaration(
- typedefDecl(hasName("BOOL"))))).bind("objc_bool_type");
+ qualType(elaboratedType(namesType(
+ typedefType(hasDeclaration(typedefDecl(hasName("BOOL")))))))
+ .bind("objc_bool_type");
// The .bind here is in order to compose the error message more accurately.
auto SuspiciousScalarBooleanTypeM =
// for storing pointers.
auto SuspiciousScalarNumberTypeM =
qualType(hasCanonicalType(isInteger()),
- unless(typedefType(hasDeclaration(
- typedefDecl(matchesName("^::u?intptr_t$"))))))
- .bind("int_type");
+ unless(elaboratedType(namesType(typedefType(hasDeclaration(
+ typedefDecl(matchesName("^::u?intptr_t$"))))))))
+ .bind("int_type");
auto SuspiciousScalarTypeM =
qualType(anyOf(SuspiciousScalarBooleanTypeM,
optionally(
isDerivedFrom(cxxRecordDecl(hasName("clang::TypeLoc"))
.bind("typeLocBase"))))),
- returns(asString(TypeString)))
+ returns(hasCanonicalType(asString(TypeString))))
.bind("classMethod")),
*ASTClass, *Result.Context);
void Test() {
constexpr S0 s0{};
- // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s0 'const S0' constexpr listinit
+ // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s0 'const S0':'const S0' constexpr listinit
// CHECK-NEXT: | |-value: Struct
// CHECK-NEXT: | | `-field: Union .i Int 42
constexpr U0 u0a{};
- // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u0a 'const U0' constexpr listinit
+ // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u0a 'const U0':'const U0' constexpr listinit
// CHECK-NEXT: | |-value: Union None
constexpr U0 u0b{3.1415f};
- // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u0b 'const U0' constexpr listinit
+ // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u0b 'const U0':'const U0' constexpr listinit
// CHECK-NEXT: | |-value: Union . Union .f Float 3.141500e+00
constexpr U1 u1a{};
- // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u1a 'const U1' constexpr listinit
+ // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u1a 'const U1':'const U1' constexpr listinit
// CHECK-NEXT: | |-value: Union . Union .f Float 0.000000e+00
constexpr U1 u1b{3.1415f};
- // CHECK: `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u1b 'const U1' constexpr listinit
+ // CHECK: `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u1b 'const U1':'const U1' constexpr listinit
// CHECK-NEXT: |-value: Union . Union .f Float 3.141500e+00
}
void Test() {
constexpr S0 s0{};
- // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s0 'const S0' constexpr listinit
+ // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s0 'const S0':'const S0' constexpr listinit
// CHECK-NEXT: | |-value: Struct
// CHECK-NEXT: | | `-fields: Int 0, Union .j Int 0
constexpr S1 s1{};
- // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s1 'const S1' constexpr listinit
+ // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s1 'const S1':'const S1' constexpr listinit
// CHECK-NEXT: | |-value: Struct
// CHECK-NEXT: | | |-field: Int 0
// CHECK-NEXT: | | `-field: Union .s
// CHECK-NEXT: | | `-field: Int 0
constexpr S2 s2{};
- // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s2 'const S2' constexpr listinit
+ // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s2 'const S2':'const S2' constexpr listinit
// CHECK-NEXT: | |-value: Struct
// CHECK-NEXT: | | `-fields: Int 0, Union .u Union .j Int 0
constexpr S3 s3{};
- // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s3 'const S3' constexpr listinit
+ // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s3 'const S3':'const S3' constexpr listinit
// CHECK-NEXT: | |-value: Struct
// CHECK-NEXT: | | |-field: Int 0
// CHECK-NEXT: | | `-field: Union .u
// CHECK-NEXT: | | `-field: Int 0
constexpr S4 s4{};
- // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s4 'const S4' constexpr listinit
+ // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s4 'const S4':'const S4' constexpr listinit
// CHECK-NEXT: | |-value: Struct
// CHECK-NEXT: | | |-base: Struct
// CHECK-NEXT: | | | `-fields: Int 0, Union .j Int 0
// CHECK-NEXT: | | `-fields: Int 4, Int 5, Int 6
constexpr S5 s5{};
- // CHECK: `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s5 'const S5' constexpr listinit
+ // CHECK: `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} s5 'const S5':'const S5' constexpr listinit
// CHECK-NEXT: |-value: Struct
// CHECK-NEXT: | |-base: Struct
// CHECK-NEXT: | | |-base: Struct
void Test() {
constexpr U0 u0{};
- // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u0 'const U0' constexpr listinit
+ // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u0 'const U0':'const U0' constexpr listinit
// CHECK-NEXT: | |-value: Union .i Int 42
constexpr U1 u1{};
- // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u1 'const U1' constexpr listinit
+ // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u1 'const U1':'const U1' constexpr listinit
// CHECK-NEXT: | |-value: Union .uinner Union .f Float 3.141500e+00
constexpr U2 u2{};
- // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u2 'const U2' constexpr listinit
+ // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u2 'const U2':'const U2' constexpr listinit
// CHECK-NEXT: | |-value: Union .uinner
// CHECK-NEXT: | | `-Union .arr
// CHECK-NEXT: | | `-Array size=2
// CHECK-NEXT: | | `-elements: Int 1, Int 2
constexpr U3 u3a = {.f = 3.1415};
- // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u3a 'const U3' constexpr cinit
+ // CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u3a 'const U3':'const U3' constexpr cinit
// CHECK-NEXT: | |-value: Union .f Float 3.141500e+00
constexpr U3 u3b = {.uinner = {}};
- // CHECK: `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u3b 'const U3' constexpr cinit
+ // CHECK: `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} u3b 'const U3':'const U3' constexpr cinit
// CHECK-NEXT: |-value: Union .uinner Union .d Float 3.141500e+00
}
return TestVarDeclNRVO;
}
}
-// CHECK: VarDecl{{.*}} TestVarDeclNRVO 'testVarDeclNRVO::A' nrvo
+// CHECK: VarDecl{{.*}} TestVarDeclNRVO 'A':'testVarDeclNRVO::A' nrvo
void testParmVarDeclInit(int TestParmVarDeclInit = 0);
// CHECK: ParmVarDecl{{.*}} TestParmVarDeclInit 'int'
// CHECK-NEXT: CopyAssignment simple non_trivial has_const_param
// CHECK-NEXT: MoveAssignment exists simple non_trivial
// CHECK-NEXT: Destructor simple irrelevant trivial
-// CHECK-NEXT: virtual private 'testCXXRecordDecl::A'
-// CHECK-NEXT: public 'testCXXRecordDecl::B'
+// CHECK-NEXT: virtual private 'A':'testCXXRecordDecl::A'
+// CHECK-NEXT: public 'B':'testCXXRecordDecl::B'
// CHECK-NEXT: CXXRecordDecl{{.*}} class TestCXXRecordDecl
// CHECK-NEXT: FieldDecl
// CHECK-NEXT: | | `-CXXRecord 0x{{.+}} 'A'
// CHECK-NEXT: | |-ParmVarDecl 0x{{.+}} <col:50> col:51 'testFunctionTemplateDecl::A':'testFunctionTemplateDecl::A'
// CHECK-NEXT: | `-CompoundStmt 0x{{.+}} <col:53, col:55>
- // CHECK-NEXT: |-Function 0x{{.+}} 'TestFunctionTemplate' 'void (testFunctionTemplateDecl::B)'
+ // CHECK-NEXT: |-Function 0x{{.+}} 'TestFunctionTemplate' 'void (B)'
// CHECK-NEXT: |-FunctionDecl 0x{{.+}} <col:24, col:55> col:29 TestFunctionTemplate 'void (testFunctionTemplateDecl::C)'
// CHECK-NEXT: | |-TemplateArgument type 'testFunctionTemplateDecl::C'
// CHECK-NEXT: | | `-RecordType 0{{.+}} 'testFunctionTemplateDecl::C'
// CHECK-NEXT: |-ParmVarDecl 0x{{.+}} <col:50> col:51 'testFunctionTemplateDecl::D':'testFunctionTemplateDecl::D'
// CHECK-NEXT: `-CompoundStmt 0x{{.+}} <col:53, col:55>
- // CHECK: FunctionDecl 0x{{.+}} prev 0x{{.+}} <{{.+}}:[[@LINE-32]]:3, col:41> col:19 TestFunctionTemplate 'void (testFunctionTemplateDecl::B)'
+ // CHECK: FunctionDecl 0x{{.+}} prev 0x{{.+}} <{{.+}}:[[@LINE-32]]:3, col:41> col:19 TestFunctionTemplate 'void (B)'
// CHECK-NEXT: |-TemplateArgument type 'testFunctionTemplateDecl::B'
// CHECK-NEXT: | `-RecordType 0{{.+}} 'testFunctionTemplateDecl::B'
// CHECK-NEXT: | `-CXXRecord 0x{{.+}} 'B'
- // CHECK-NEXT: `-ParmVarDecl 0x{{.+}} <col:40> col:41 'testFunctionTemplateDecl::B'
+ // CHECK-NEXT: `-ParmVarDecl 0x{{.+}} <col:40> col:41 'B':'testFunctionTemplateDecl::B'
namespace testClassTemplateDecl {
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "obj1",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "name": "obj1",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "name": "obj1",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "a",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "name": "a",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "name": "a",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "name": "a",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "name": "a",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "name": "a",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "typeArg": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "typeArg": {
+// CHECK-NEXT: "desugaredQualType": "const volatile S",
// CHECK-NEXT: "qualType": "const volatile S"
// CHECK-NEXT: },
// CHECK-NEXT: "adjustedTypeArg": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (*)(NS::X)"
+// CHECK-NEXT: "qualType": "void (*)(X)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "FunctionToPointerDecay",
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (NS::X)"
+// CHECK-NEXT: "qualType": "void (X)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "name": "f",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (NS::X)"
+// CHECK-NEXT: "qualType": "void (X)"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "NS::X"
+// CHECK-NEXT: "desugaredQualType": "NS::X",
+// CHECK-NEXT: "qualType": "X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "ctorType": {
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (*)(NS::X)"
+// CHECK-NEXT: "qualType": "void (*)(X)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "FunctionToPointerDecay",
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (NS::X)"
+// CHECK-NEXT: "qualType": "void (X)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "name": "f",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (NS::X)"
+// CHECK-NEXT: "qualType": "void (X)"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "NS::X"
+// CHECK-NEXT: "desugaredQualType": "NS::X",
+// CHECK-NEXT: "qualType": "X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "ctorType": {
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (*)(NS::X)"
+// CHECK-NEXT: "qualType": "void (*)(X)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "FunctionToPointerDecay",
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (NS::X)"
+// CHECK-NEXT: "qualType": "void (X)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "name": "f",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (NS::X)"
+// CHECK-NEXT: "qualType": "void (X)"
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "foundReferencedDecl": {
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "NS::X"
+// CHECK-NEXT: "desugaredQualType": "NS::X",
+// CHECK-NEXT: "qualType": "X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "ctorType": {
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "x",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "NS::X"
+// CHECK-NEXT: "desugaredQualType": "NS::X",
+// CHECK-NEXT: "qualType": "X"
// CHECK-NEXT: },
// CHECK-NEXT: "init": "call",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "NS::X"
+// CHECK-NEXT: "desugaredQualType": "NS::X",
+// CHECK-NEXT: "qualType": "X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "ctorType": {
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (*)(NS::X)"
+// CHECK-NEXT: "qualType": "void (*)(X)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "castKind": "FunctionToPointerDecay",
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (NS::X)"
+// CHECK-NEXT: "qualType": "void (X)"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "name": "f",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (NS::X)"
+// CHECK-NEXT: "qualType": "void (X)"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "NS::X"
+// CHECK-NEXT: "desugaredQualType": "NS::X",
+// CHECK-NEXT: "qualType": "X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "ctorType": {
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "NS::X"
+// CHECK-NEXT: "desugaredQualType": "NS::X",
+// CHECK-NEXT: "qualType": "X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "name": "x",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "NS::X"
+// CHECK-NEXT: "desugaredQualType": "NS::X",
+// CHECK-NEXT: "qualType": "X"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
void PointerToMember(S obj1, S *obj2, int S::* data, void (S::*call)(int)) {
obj1.*data;
// CHECK: BinaryOperator 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:9> 'int' lvalue '.*'
- // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S' lvalue ParmVar 0x{{[^ ]*}} 'obj1' 'S'
+ // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S':'S' lvalue ParmVar 0x{{[^ ]*}} 'obj1' 'S':'S'
// CHECK-NEXT: ImplicitCastExpr
// CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:9> 'int S::*' lvalue ParmVar 0x{{[^ ]*}} 'data' 'int S::*'
// CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:18> 'void'
// CHECK-NEXT: ParenExpr 0x{{[^ ]*}} <col:3, col:14> '<bound member function type>'
// CHECK-NEXT: BinaryOperator 0x{{[^ ]*}} <col:4, col:10> '<bound member function type>' '.*'
- // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:4> 'S' lvalue ParmVar 0x{{[^ ]*}} 'obj1' 'S'
+ // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:4> 'S':'S' lvalue ParmVar 0x{{[^ ]*}} 'obj1' 'S':'S'
// CHECK-NEXT: ImplicitCastExpr
// CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:10> 'void (S::*)(int)' lvalue ParmVar 0x{{[^ ]*}} 'call' 'void (S::*)(int)'
// CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:16> 'int' 12
}
void Casting(const S *s) {
- // FIXME: The cast expressions contain "struct S" instead of "S".
-
const_cast<S *>(s);
- // CHECK: CXXConstCastExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:20> 'S *' const_cast<struct S *> <NoOp>
+ // CHECK: CXXConstCastExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:20> 'S *' const_cast<S *> <NoOp>
// CHECK-NEXT: ImplicitCastExpr 0x{{[^ ]*}} <col:19> 'const S *' <LValueToRValue> part_of_explicit_cast
// CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:19> 'const S *' lvalue ParmVar 0x{{[^ ]*}} 's' 'const S *'
static_cast<const T *>(s);
- // CHECK: CXXStaticCastExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:27> 'const T *' static_cast<const struct T *> <BaseToDerived (S)>
+ // CHECK: CXXStaticCastExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:27> 'const T *' static_cast<const T *> <BaseToDerived (S)>
// CHECK-NEXT: ImplicitCastExpr 0x{{[^ ]*}} <col:26> 'const S *' <LValueToRValue> part_of_explicit_cast
// CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:26> 'const S *' lvalue ParmVar 0x{{[^ ]*}} 's' 'const S *'
dynamic_cast<const T *>(s);
- // CHECK: CXXDynamicCastExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:28> 'const T *' dynamic_cast<const struct T *> <Dynamic>
+ // CHECK: CXXDynamicCastExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:28> 'const T *' dynamic_cast<const T *> <Dynamic>
// CHECK-NEXT: ImplicitCastExpr 0x{{[^ ]*}} <col:27> 'const S *' <LValueToRValue> part_of_explicit_cast
// CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:27> 'const S *' lvalue ParmVar 0x{{[^ ]*}} 's' 'const S *'
a.func(0);
// CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:11> 'void'
// CHECK-NEXT: MemberExpr 0x{{[^ ]*}} <col:3, col:5> '<bound member function type>' .func 0x{{[^ ]*}}
- // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S' lvalue ParmVar 0x{{[^ ]*}} 'a' 'S'
+ // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S':'S' lvalue ParmVar 0x{{[^ ]*}} 'a' 'S':'S'
// CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:10> 'int' 0
p->func(0);
a.template foo<float>();
// CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:25> 'float':'float'
// CHECK-NEXT: MemberExpr 0x{{[^ ]*}} <col:3, col:23> '<bound member function type>' .foo 0x{{[^ ]*}}
- // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S' lvalue ParmVar 0x{{[^ ]*}} 'a' 'S'
+ // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S':'S' lvalue ParmVar 0x{{[^ ]*}} 'a' 'S':'S'
p->~S();
// CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:9> 'void'
a.~S();
// CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:8> 'void'
// CHECK-NEXT: MemberExpr 0x{{[^ ]*}} <col:3, col:6> '<bound member function type>' .~S 0x{{[^ ]*}}
- // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S' lvalue ParmVar 0x{{[^ ]*}} 'a' 'S'
+ // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S':'S' lvalue ParmVar 0x{{[^ ]*}} 'a' 'S':'S'
// FIXME: there seems to be no way to distinguish the construct below from
// the construct above.
a.~decltype(a)();
// CHECK: CXXMemberCallExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:18> 'void'
// CHECK-NEXT: MemberExpr 0x{{[^ ]*}} <col:3, col:5> '<bound member function type>' .~S 0x{{[^ ]*}}
- // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S' lvalue ParmVar 0x{{[^ ]*}} 'a' 'S'
+ // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:3> 'S':'S' lvalue ParmVar 0x{{[^ ]*}} 'a' 'S':'S'
// FIXME: similarly, there is no way to distinguish the construct below from
// the p->~S() case.
typeid(a);
// CHECK: CXXTypeidExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:11> 'const std::type_info' lvalue
- // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:10> 'S' lvalue ParmVar 0x{{[^ ]*}} 'a' 'S'
+ // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:10> 'S':'S' lvalue ParmVar 0x{{[^ ]*}} 'a' 'S':'S'
// FIXME: no type information is printed for the argument.
typeid(S);
// CHECK-NEXT: CXXCtorInitializer Field 0x{{[^ ]*}} 'j' 'int'
// CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:17> 'int' 0
// CHECK-NEXT: CXXCtorInitializer Field 0x{{[^ ]*}} 'r' 'R'
- // CHECK-NEXT: CXXConstructExpr 0x{{[^ ]*}} <col:3> 'R' 'void () noexcept'
+ // CHECK-NEXT: CXXConstructExpr 0x{{[^ ]*}} <col:3> 'R':'R' 'void () noexcept'
// CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:20, col:21>
void a();
// CHECK-NEXT: | | |-DeclStmt [[ADDR_44:0x[a-z0-9]*]] <line:18:3, col:11>
// CHECK-NEXT: | | | `-VarDecl [[ADDR_45:0x[a-z0-9]*]] <col:3, col:10> col:10 referenced t 'double'
// CHECK-NEXT: | | |-DeclStmt [[ADDR_46:0x[a-z0-9]*]] <line:19:3, col:16>
-// CHECK-NEXT: | | | `-VarDecl [[ADDR_47:0x[a-z0-9]*]] <col:3, col:15> col:8 q 'S<T>' callinit
+// CHECK-NEXT: | | | `-VarDecl [[ADDR_47:0x[a-z0-9]*]] <col:3, col:15> col:8 q 'S<T>':'S<T>' callinit
// CHECK-NEXT: | | | `-ParenListExpr [[ADDR_48:0x[a-z0-9]*]] <col:9, col:15> 'NULL TYPE'
// CHECK-NEXT: | | | |-IntegerLiteral [[ADDR_49:0x[a-z0-9]*]] <col:10> 'int' 1
// CHECK-NEXT: | | | `-UnaryOperator [[ADDR_50:0x[a-z0-9]*]] <col:13, col:14> 'double *' prefix '&' cannot overflow
// CHECK-NEXT: | | |-DeclStmt [[ADDR_72:0x[a-z0-9]*]] <line:24:3, col:6>
// CHECK-NEXT: | | | `-VarDecl [[ADDR_73:0x[a-z0-9]*]] <col:3, col:5> col:5 referenced t 'T'
// CHECK-NEXT: | | |-DeclStmt [[ADDR_74:0x[a-z0-9]*]] <line:25:3, col:16>
-// CHECK-NEXT: | | | `-VarDecl [[ADDR_75:0x[a-z0-9]*]] <col:3, col:15> col:8 q 'S<T>' callinit
+// CHECK-NEXT: | | | `-VarDecl [[ADDR_75:0x[a-z0-9]*]] <col:3, col:15> col:8 q 'S<T>':'S<T>' callinit
// CHECK-NEXT: | | | `-ParenListExpr [[ADDR_76:0x[a-z0-9]*]] <col:9, col:15> 'NULL TYPE'
// CHECK-NEXT: | | | |-IntegerLiteral [[ADDR_77:0x[a-z0-9]*]] <col:10> 'int' 0
// CHECK-NEXT: | | | `-UnaryOperator [[ADDR_78:0x[a-z0-9]*]] <col:13, col:14> '<dependent type>' prefix '&' cannot overflow
// CHECK-NEXT: | |-DeclStmt [[ADDR_101:0x[a-z0-9]*]] <line:31:3, col:11>
// CHECK-NEXT: | | `-VarDecl [[ADDR_102:0x[a-z0-9]*]] <col:3, col:10> col:10 referenced t 'double'
// CHECK-NEXT: | |-DeclStmt [[ADDR_103:0x[a-z0-9]*]] <line:32:3, col:18>
-// CHECK-NEXT: | | `-VarDecl [[ADDR_104:0x[a-z0-9]*]] <col:3, col:17> col:8 q 'S<T>' callinit
+// CHECK-NEXT: | | `-VarDecl [[ADDR_104:0x[a-z0-9]*]] <col:3, col:17> col:8 q 'S<T>':'S<T>' callinit
// CHECK-NEXT: | | `-ParenListExpr [[ADDR_105:0x[a-z0-9]*]] <col:9, col:17> 'NULL TYPE'
// CHECK-NEXT: | | |-FloatingLiteral [[ADDR_106:0x[a-z0-9]*]] <col:10> 'double' 2.000000e+00
// CHECK-NEXT: | | `-UnaryOperator [[ADDR_107:0x[a-z0-9]*]] <col:15, col:16> 'double *' prefix '&' cannot overflow
// CHECK-NEXT: | |-CXXOperatorCallExpr {{.*}} <line:16:3, col:7> 'void' '+'
// CHECK-NEXT: | | |-ImplicitCastExpr {{.*}} <col:5> 'void (*)(E, E)' <FunctionToPointerDecay>
// CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <col:5> 'void (E, E)' lvalue Function {{.*}} 'operator+' 'void (E, E)'
-// CHECK-NEXT: | | |-ImplicitCastExpr {{.*}} <col:3> 'E' <LValueToRValue>
-// CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <col:3> 'E' lvalue Var {{.*}} 'e' 'E'
-// CHECK-NEXT: | | `-ImplicitCastExpr {{.*}} <col:7> 'E' <LValueToRValue>
-// CHECK-NEXT: | | `-DeclRefExpr {{.*}} <col:7> 'E' lvalue Var {{.*}} 'e' 'E'
+// CHECK-NEXT: | | |-ImplicitCastExpr {{.*}} <col:3> 'E':'E' <LValueToRValue>
+// CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <col:3> 'E':'E' lvalue Var {{.*}} 'e' 'E':'E'
+// CHECK-NEXT: | | `-ImplicitCastExpr {{.*}} <col:7> 'E':'E' <LValueToRValue>
+// CHECK-NEXT: | | `-DeclRefExpr {{.*}} <col:7> 'E':'E' lvalue Var {{.*}} 'e' 'E':'E'
// CHECK-NEXT: | `-CXXOperatorCallExpr {{.*}} <line:17:3, col:7> 'void' ','
// CHECK-NEXT: | |-ImplicitCastExpr {{.*}} <col:5> 'void (*)(E, E)' <FunctionToPointerDecay>
// CHECK-NEXT: | | `-DeclRefExpr {{.*}} <col:5> 'void (E, E)' lvalue Function {{.*}} 'operator,' 'void (E, E)'
-// CHECK-NEXT: | |-ImplicitCastExpr {{.*}} <col:3> 'E' <LValueToRValue>
-// CHECK-NEXT: | | `-DeclRefExpr {{.*}} <col:3> 'E' lvalue Var {{.*}} 'e' 'E'
-// CHECK-NEXT: | `-ImplicitCastExpr {{.*}} <col:7> 'E' <LValueToRValue>
-// CHECK-NEXT: | `-DeclRefExpr {{.*}} <col:7> 'E' lvalue Var {{.*}} 'e' 'E'
+// CHECK-NEXT: | |-ImplicitCastExpr {{.*}} <col:3> 'E':'E' <LValueToRValue>
+// CHECK-NEXT: | | `-DeclRefExpr {{.*}} <col:3> 'E':'E' lvalue Var {{.*}} 'e' 'E':'E'
+// CHECK-NEXT: | `-ImplicitCastExpr {{.*}} <col:7> 'E':'E' <LValueToRValue>
+// CHECK-NEXT: | `-DeclRefExpr {{.*}} <col:7> 'E':'E' lvalue Var {{.*}} 'e' 'E':'E'
namespace a {
void operator-(E, E);
// CHECK-NEXT: {
// CHECK-NEXT: "access": "public",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "Base1",
// CHECK-NEXT: "qualType": "Base1"
// CHECK-NEXT: },
// CHECK-NEXT: "writtenAccess": "none"
// CHECK-NEXT: {
// CHECK-NEXT: "access": "private",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "Base1",
// CHECK-NEXT: "qualType": "Base1"
// CHECK-NEXT: },
// CHECK-NEXT: "writtenAccess": "private"
// CHECK-NEXT: "access": "public",
// CHECK-NEXT: "isVirtual": true,
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "Base1",
// CHECK-NEXT: "qualType": "Base1"
// CHECK-NEXT: },
// CHECK-NEXT: "writtenAccess": "none"
// CHECK-NEXT: {
// CHECK-NEXT: "access": "public",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "Base1",
// CHECK-NEXT: "qualType": "Base1"
// CHECK-NEXT: },
// CHECK-NEXT: "writtenAccess": "none"
// CHECK-NEXT: "access": "public",
// CHECK-NEXT: "isVirtual": true,
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "Base2",
// CHECK-NEXT: "qualType": "Base2"
// CHECK-NEXT: },
// CHECK-NEXT: "writtenAccess": "none"
// CHECK-NEXT: {
// CHECK-NEXT: "access": "protected",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "Base3",
// CHECK-NEXT: "qualType": "Base3"
// CHECK-NEXT: },
// CHECK-NEXT: "writtenAccess": "protected"
// CHECK-NEXT: "access": "protected",
// CHECK-NEXT: "isVirtual": true,
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "Base1",
// CHECK-NEXT: "qualType": "Base1"
// CHECK-NEXT: },
// CHECK-NEXT: "writtenAccess": "protected"
// CHECK-NEXT: | `-DeclRefExpr {{.*}} 'f'
// CHECK-NEXT: `-IntegerLiteral {{.*}} 'int' 1
f.func(1);
- // CHECK: RecoveryExpr {{.*}} 'Foo2::ForwardClass'
+ // CHECK: RecoveryExpr {{.*}} 'ForwardClass':'Foo2::ForwardClass'
// CHECK-NEXT: `-MemberExpr {{.*}} '<bound member function type>' .createFwd
// CHECK-NEXT: `-DeclRefExpr {{.*}} 'f'
f.createFwd();
// CHECK-NEXT: `-InitListExpr
Bar b2 = {1};
// CHECK: `-VarDecl {{.*}} b3 'Bar'
- // CHECK-NEXT: `-RecoveryExpr {{.*}} 'Bar' contains-errors
+ // CHECK-NEXT: `-RecoveryExpr {{.*}} 'Bar':'Bar' contains-errors
// CHECK-NEXT: `-DeclRefExpr {{.*}} 'x' 'int'
Bar b3 = Bar(x);
// CHECK: `-VarDecl {{.*}} b4 'Bar'
- // CHECK-NEXT: `-RecoveryExpr {{.*}} 'Bar' contains-errors
+ // CHECK-NEXT: `-RecoveryExpr {{.*}} 'Bar':'Bar' contains-errors
// CHECK-NEXT: `-InitListExpr {{.*}} 'void'
// CHECK-NEXT: `-DeclRefExpr {{.*}} 'x' 'int'
Bar b4 = Bar{x};
// CHECK: `-VarDecl {{.*}} b5 'Bar'
- // CHECK-NEXT: `-CXXUnresolvedConstructExpr {{.*}} 'Bar' contains-errors 'Bar'
+ // CHECK-NEXT: `-CXXUnresolvedConstructExpr {{.*}} 'Bar':'Bar' contains-errors 'Bar'
// CHECK-NEXT: `-RecoveryExpr {{.*}} contains-errors
// CHECK-NEXT: `-UnresolvedLookupExpr {{.*}} 'invalid'
Bar b5 = Bar(invalid());
// CHECK: `-VarDecl {{.*}} b6 'Bar'
- // CHECK-NEXT: `-CXXUnresolvedConstructExpr {{.*}} 'Bar' contains-errors 'Bar'
+ // CHECK-NEXT: `-CXXUnresolvedConstructExpr {{.*}} 'Bar':'Bar' contains-errors 'Bar'
// CHECK-NEXT: `-InitListExpr {{.*}} contains-errors
// CHECK-NEXT: `-RecoveryExpr {{.*}} contains-errors
// CHECK-NEXT: `-UnresolvedLookupExpr {{.*}} 'invalid'
Bar b6 = Bar{invalid()};
- // CHECK: RecoveryExpr {{.*}} 'Bar' contains-errors
+ // CHECK: RecoveryExpr {{.*}} 'Bar':'Bar' contains-errors
// CHECK-NEXT: `-IntegerLiteral {{.*}} 'int' 1
Bar(1);
// CHECK-NEXT: | `-RecoveryExpr {{.*}} '<dependent type>'
// CHECK-NEXT: | `-UnresolvedLookupExpr {{.*}} '<overloaded function type>'
// CHECK-NEXT: |-CXXCtorInitializer Field {{.*}} 's' 'S'
- // CHECK-NEXT: | `-RecoveryExpr {{.*}} 'S' contains-errors
+ // CHECK-NEXT: | `-RecoveryExpr {{.*}} 'S':'S' contains-errors
// CHECK-NEXT: | |-IntegerLiteral {{.*}} 1
// CHECK-NEXT: | `-IntegerLiteral {{.*}} 2
};
// CHECK-NEXT: "isReferenced": true,
// CHECK-NEXT: "name": "obj",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "DependentScopeMemberExprWrapper<T>",
// CHECK-NEXT: "qualType": "DependentScopeMemberExprWrapper<T>"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "DependentScopeMemberExprWrapper<T>",
// CHECK-NEXT: "qualType": "DependentScopeMemberExprWrapper<T>"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "name": "obj",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "DependentScopeMemberExprWrapper<T>",
// CHECK-NEXT: "qualType": "DependentScopeMemberExprWrapper<T>"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "DependentScopeMemberExprWrapper<T>",
// CHECK-NEXT: "qualType": "DependentScopeMemberExprWrapper<T>"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "name": "obj",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "DependentScopeMemberExprWrapper<T>",
// CHECK-NEXT: "qualType": "DependentScopeMemberExprWrapper<T>"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "DependentScopeMemberExprWrapper<T>",
// CHECK-NEXT: "qualType": "DependentScopeMemberExprWrapper<T>"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "name": "obj",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "DependentScopeMemberExprWrapper<T>",
// CHECK-NEXT: "qualType": "DependentScopeMemberExprWrapper<T>"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: "isReferenced": true,
// CHECK-NEXT: "name": "obj",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "OtherDependentScopeMemberExprWrapper<T>",
// CHECK-NEXT: "qualType": "OtherDependentScopeMemberExprWrapper<T>"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "OtherDependentScopeMemberExprWrapper<T>",
// CHECK-NEXT: "qualType": "OtherDependentScopeMemberExprWrapper<T>"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "name": "obj",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "OtherDependentScopeMemberExprWrapper<T>",
// CHECK-NEXT: "qualType": "OtherDependentScopeMemberExprWrapper<T>"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "U",
// CHECK-NEXT: "qualType": "U"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "U",
// CHECK-NEXT: "qualType": "U"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "C",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "Container",
// CHECK-NEXT: "qualType": "Container"
// CHECK-NEXT: },
// CHECK-NEXT: "init": "call",
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "Container",
// CHECK-NEXT: "qualType": "Container"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "Container",
// CHECK-NEXT: "qualType": "Container"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "name": "C",
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "Container",
// CHECK-NEXT: "qualType": "Container"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "Container",
// CHECK-NEXT: "qualType": "Container"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "Container",
// CHECK-NEXT: "qualType": "Container"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
U us[3] = {1};
// CHECK: VarDecl {{.+}} <col:3, col:15> col:5 us 'U[3]' cinit
// CHECK-NEXT: `-InitListExpr {{.+}} <col:13, col:15> 'U[3]'
-// CHECK-NEXT: |-array_filler: InitListExpr {{.+}} <col:15> 'U' field Field {{.+}} 'i' 'int'
-// CHECK-NEXT: `-InitListExpr {{.+}} <col:14> 'U' field Field {{.+}} 'i' 'int'
+// CHECK-NEXT: |-array_filler: InitListExpr {{.+}} <col:15> 'U':'U' field Field {{.+}} 'i' 'int'
+// CHECK-NEXT: `-InitListExpr {{.+}} <col:14> 'U':'U' field Field {{.+}} 'i' 'int'
// CHECK-NEXT: `-IntegerLiteral {{.+}} <col:14> 'int' 1
}
// CHECK-NEXT: <<<NULL>>>
// CHECK-NEXT: DeclStmt
// CHECK-NEXT: VarDecl 0x{{[^ ]*}} <col:16> col:16 implicit used __range1 'Container &' cinit
- // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:16> 'Container' lvalue Var 0x{{[^ ]*}} 'C' 'Container'
+ // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:16> 'Container':'Container' lvalue Var 0x{{[^ ]*}} 'C' 'Container':'Container'
// CHECK-NEXT: DeclStmt
// CHECK-NEXT: VarDecl 0x{{[^ ]*}} <col:14> col:14 implicit used __begin1 'int *':'int *' cinit
// CHECK-NEXT: CXXMemberCallExpr 0x{{[^ ]*}} <col:14> 'int *'
// CHECK-NEXT: MemberExpr 0x{{[^ ]*}} <col:14> '<bound member function type>' .begin 0x{{[^ ]*}}
// CHECK-NEXT: ImplicitCastExpr
- // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:14> 'Container' lvalue Var 0x{{[^ ]*}} '__range1' 'Container &'
+ // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:14> 'Container':'Container' lvalue Var 0x{{[^ ]*}} '__range1' 'Container &'
// CHECK-NEXT: DeclStmt
// CHECK-NEXT: VarDecl 0x{{[^ ]*}} <col:14> col:14 implicit used __end1 'int *':'int *' cinit
// CHECK-NEXT: CXXMemberCallExpr 0x{{[^ ]*}} <col:14> 'int *'
// CHECK-NEXT: MemberExpr 0x{{[^ ]*}} <col:14> '<bound member function type>' .end 0x{{[^ ]*}}
// CHECK-NEXT: ImplicitCastExpr
- // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:14> 'Container' lvalue Var 0x{{[^ ]*}} '__range1' 'Container &'
+ // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:14> 'Container':'Container' lvalue Var 0x{{[^ ]*}} '__range1' 'Container &'
// CHECK-NEXT: BinaryOperator 0x{{[^ ]*}} <col:14> 'bool' '!='
// CHECK-NEXT: ImplicitCastExpr
// CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:14> 'int *':'int *' lvalue Var 0x{{[^ ]*}} '__begin1' 'int *':'int *'
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "Uy<Ty>",
// CHECK-NEXT: "qualType": "Uy<Ty>"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "const S",
// CHECK-NEXT: "qualType": "const S"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "const S",
// CHECK-NEXT: "qualType": "const S"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "const S",
// CHECK-NEXT: "qualType": "const S"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "S",
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
template<typename T>
using A = S<T>;
// CHECK: TypeAliasDecl
-// CHECK-NEXT: `-TemplateSpecializationType {{.*}} 'S<T>' dependent using S
+// CHECK-NEXT: `-ElaboratedType {{.*}} 'S<T>' sugar dependent
+// CHECK-NEXT: `-TemplateSpecializationType {{.*}} 'S<T>' dependent using S
// TemplateName in TemplateArgument.
template <template <typename> class T> class X {};
using B = X<S>;
// CHECK: TypeAliasDecl
-// CHECK-NEXT: `-TemplateSpecializationType {{.*}} 'X<ns::S>' sugar X
-// CHECK-NEXT: |-TemplateArgument using template S
-// CHECK-NEXT: `-RecordType {{.*}} 'X<ns::S>'
-// CHECK-NEXT: `-ClassTemplateSpecialization {{.*}} 'X'
+// CHECK-NEXT: `-ElaboratedType {{.*}} 'X<ns::S>' sugar
+// CHECK-NEXT: `-TemplateSpecializationType {{.*}} 'X<ns::S>' sugar X
+// CHECK-NEXT: |-TemplateArgument using template S
+// CHECK-NEXT: `-RecordType {{.*}} 'X<ns::S>'
+// CHECK-NEXT: `-ClassTemplateSpecialization {{.*}} 'X'
// TemplateName in DeducedTemplateSpecializationType.
S DeducedTemplateSpecializationT(123);
using C = decltype(DeducedTemplateSpecializationT);
// CHECK: DecltypeType {{.*}}
// CHECK-NEXT: |-DeclRefExpr {{.*}}
-// CHECK-NEXT: `-DeducedTemplateSpecializationType {{.*}} 'ns::S<int>' sugar using
+// CHECK-NEXT: `-ElaboratedType {{.*}} 'S<int>' sugar
+// CHECK-NEXT: `-DeducedTemplateSpecializationType {{.*}} 'ns::S<int>' sugar using
// CHECK-NEXT: `-RecordType {{.*}} 'a::S'
typedef S f; // to dump the introduced type
// CHECK: TypedefDecl
-// CHECK-NEXT: `-UsingType {{.*}} 'a::S' sugar
-// CHECK-NEXT: |-UsingShadow {{.*}} 'S'
-// CHECK-NEXT: `-RecordType {{.*}} 'a::S'
+// CHECK-NEXT: `-ElaboratedType {{.*}} 'S' sugar
+// CHECK-NEXT: `-UsingType {{.*}} 'a::S' sugar
+// CHECK-NEXT: |-UsingShadow {{.*}} 'S'
+// CHECK-NEXT: `-RecordType {{.*}} 'a::S'
}
// CHECK: CaseStmt
// CHECK: ExprWithCleanups {{.*}} 'void'
// CHECK-NEXT: CoawaitExpr
-// CHECK-NEXT: CXXBindTemporaryExpr {{.*}} 'Task' (CXXTemporary {{.*}})
-// CHECK: MaterializeTemporaryExpr {{.*}} 'Task::Awaiter':'Task::Awaiter'
+// CHECK-NEXT: CXXBindTemporaryExpr {{.*}} 'Task':'Task' (CXXTemporary {{.*}})
+// CHECK: MaterializeTemporaryExpr {{.*}} 'Awaiter':'Task::Awaiter'
// CHECK: ExprWithCleanups {{.*}} 'bool'
// CHECK-NEXT: CXXMemberCallExpr {{.*}} 'bool'
// CHECK-NEXT: MemberExpr {{.*}} .await_ready
// CHECK: CaseStmt
// CHECK: ExprWithCleanups {{.*}} 'void'
// CHECK-NEXT: CoawaitExpr
-// CHECK-NEXT: CXXBindTemporaryExpr {{.*}} 'Task' (CXXTemporary {{.*}})
-// CHECK: MaterializeTemporaryExpr {{.*}} 'Task::Awaiter':'Task::Awaiter'
+// CHECK-NEXT: CXXBindTemporaryExpr {{.*}} 'Task':'Task' (CXXTemporary {{.*}})
+// CHECK: MaterializeTemporaryExpr {{.*}} 'Awaiter':'Task::Awaiter'
// CHECK: ExprWithCleanups {{.*}} 'bool'
// CHECK-NEXT: CXXMemberCallExpr {{.*}} 'bool'
// CHECK-NEXT: MemberExpr {{.*}} .await_ready
// CHECK: CaseStmt
// CHECK: ExprWithCleanups {{.*}} 'void'
// CHECK-NEXT: CoawaitExpr
-// CHECK-NEXT: CXXBindTemporaryExpr {{.*}} 'Task' (CXXTemporary {{.*}})
-// CHECK: MaterializeTemporaryExpr {{.*}} 'Task::Awaiter':'Task::Awaiter'
+// CHECK-NEXT: CXXBindTemporaryExpr {{.*}} 'Task':'Task' (CXXTemporary {{.*}})
+// CHECK: MaterializeTemporaryExpr {{.*}} 'Awaiter':'Task::Awaiter'
// CHECK: ExprWithCleanups {{.*}} 'bool'
// CHECK-NEXT: CXXMemberCallExpr {{.*}} 'bool'
// CHECK-NEXT: MemberExpr {{.*}} .await_ready
// CHECK: CaseStmt
// CHECK: ExprWithCleanups {{.*}} 'void'
// CHECK-NEXT: CoawaitExpr
-// CHECK-NEXT: CXXBindTemporaryExpr {{.*}} 'Task' (CXXTemporary {{.*}})
-// CHECK: MaterializeTemporaryExpr {{.*}} 'Task::Awaiter':'Task::Awaiter'
+// CHECK-NEXT: CXXBindTemporaryExpr {{.*}} 'Task':'Task' (CXXTemporary {{.*}})
+// CHECK: MaterializeTemporaryExpr {{.*}} 'Awaiter':'Task::Awaiter'
// CHECK: ExprWithCleanups {{.*}} 'bool'
// CHECK-NEXT: CXXMemberCallExpr {{.*}} 'bool'
// CHECK-NEXT: MemberExpr {{.*}} .await_ready
//CHECK-NEXT: | `-FloatingLiteral {{.*}} 'double' 1.000977e+00
C1 c1(f1l);
-//CHECK: | `-VarDecl{{.*}} used c1 'C1' callinit
-//CHECK-NEXT: | `-CXXConstructExpr {{.*}} 'C1' 'void (_Float16)
+//CHECK: | `-VarDecl{{.*}} used c1 'C1':'C1' callinit
+//CHECK-NEXT: | `-CXXConstructExpr {{.*}} 'C1':'C1' 'void (_Float16)
//CHECK-NEXT: | `-ImplicitCastExpr {{.*}} '_Float16' <LValueToRValue>
//CHECK-NEXT: | `-DeclRefExpr {{.*}} '_Float16' lvalue Var 0x{{.*}} 'f1l' '_Float16'
//CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} '_Float16' lvalue Var {{.*}} 'f2l' '_Float16'
//CHECK-NEXT: | | | | | | `-CXXMemberCallExpr {{.*}} '_Float16'
//CHECK-NEXT: | | | | | | |-MemberExpr {{.*}} '<bound member function type>' .func1c {{.*}}
-//CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'C1' lvalue Var {{.*}} 'c1' 'C1'
+//CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'C1':'C1' lvalue Var {{.*}} 'c1' 'C1':'C1'
//CHECK-NEXT: | | | | | | `-ImplicitCastExpr {{.*}} '_Float16' <LValueToRValue>
//CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} '_Float16' lvalue Var {{.*}} 'f3l' '_Float16'
//CHECK-NEXT: | | | | | `-CallExpr {{.*}} '_Float16'
//CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} '_Float16 (*)(_Float16)' <FunctionToPointerDecay>
//CHECK-NEXT: | | | | | | `-MemberExpr {{.*}} '_Float16 (_Float16)' lvalue .func2c {{.*}}
-//CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} 'C1' lvalue Var {{.*}} 'c1' 'C1'
+//CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} 'C1':'C1' lvalue Var {{.*}} 'c1' 'C1':'C1'
//CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} '_Float16' <LValueToRValue>
//CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} '_Float16' lvalue Var {{.*}} 'f1l' '_Float16'
//CHECK-NEXT: | | | | `-CallExpr {{.*}} '_Float16':'_Float16'
void construct() {
using namespace foo;
A a = A(12);
- // CHECK: CXXConstructExpr {{0x[0-9a-fA-F]+}} <col:9, col:13> 'foo::A' 'void (int){{( __attribute__\(\(thiscall\)\))?}}'
+ // CHECK: CXXConstructExpr {{0x[0-9a-fA-F]+}} <col:9, col:13> 'A':'foo::A' 'void (int){{( __attribute__\(\(thiscall\)\))?}}'
D d = D(12);
- // CHECK: CXXConstructExpr {{0x[0-9a-fA-F]+}} <col:9, col:13> 'D' 'void (int){{( __attribute__\(\(thiscall\)\))?}}'
+ // CHECK: CXXConstructExpr {{0x[0-9a-fA-F]+}} <col:9, col:13> 'D':'D' 'void (int){{( __attribute__\(\(thiscall\)\))?}}'
}
namespace PR38987 {
// CHECK-1Z: CXXRecordDecl {{.*}} struct B definition
struct B {
- // CHECK-1Z: FieldDecl {{.*}} a 'in_class_init::A'
+ // CHECK-1Z: FieldDecl {{.*}} a 'A':'in_class_init::A'
// CHECK-1Z-NEXT: InitListExpr {{.*}} <col:11, col:12
A a = {};
};
// CHECK-1Z: CXXRecordDecl {{.*}} struct C definition
struct C : B {
// CHECK-1Z: CXXConstructorDecl {{.*}} C
- // CHECK-1Z-NEXT: CXXCtorInitializer 'delegating_constructor_init::B'
+ // CHECK-1Z-NEXT: CXXCtorInitializer 'B':'delegating_constructor_init::B'
// CHECK-1Z-NEXT: CXXConstructExpr {{.*}} <col:11, col:15
// CHECK-1Z-NEXT: InitListExpr {{.*}} <col:13, col:14
C() : B({}) {};
<key>type</key><string>Double free</string>
<key>check_name</key><string>cplusplus.NewDelete</string>
<!-- This hash is experimental and going to change! -->
- <key>issue_hash_content_of_line_in_context</key><string>8bf1a5b9fdae9d86780aa6c4cdce2605</string>
+ <key>issue_hash_content_of_line_in_context</key><string>f3139fe330e830526fe60a2e19266627</string>
<key>issue_context_kind</key><string>function</string>
<key>issue_context</key><string>test</string>
<key>issue_hash_function_offset</key><string>3</string>
<key>type</key><string>Dereference of null pointer</string>
<key>check_name</key><string>core.NullDereference</string>
<!-- This hash is experimental and going to change! -->
- <key>issue_hash_content_of_line_in_context</key><string>f53792d63dffe6176babc00ee455a3e0</string>
+ <key>issue_hash_content_of_line_in_context</key><string>988b3441112848444b50d572900b0c5f</string>
<key>issue_context_kind</key><string>function</string>
<key>issue_context</key><string>get</string>
<key>issue_hash_function_offset</key><string>2</string>
<key>type</key><string>Called C++ object pointer is null</string>
<key>check_name</key><string>core.CallAndMessage</string>
<!-- This hash is experimental and going to change! -->
- <key>issue_hash_content_of_line_in_context</key><string>c5bd8e35fb6da070914016804720ae4d</string>
+ <key>issue_hash_content_of_line_in_context</key><string>f15e85d881c87a35df8a4d30e1db5ed7</string>
<key>issue_context_kind</key><string>function</string>
<key>issue_context</key><string>test_ic_null</string>
<key>issue_hash_function_offset</key><string>2</string>
<key>type</key><string>Called C++ object pointer is null</string>
<key>check_name</key><string>core.CallAndMessage</string>
<!-- This hash is experimental and going to change! -->
- <key>issue_hash_content_of_line_in_context</key><string>e23397f9f2eff1b08593c2b2db137494</string>
+ <key>issue_hash_content_of_line_in_context</key><string>8efb5c75089d50fcdc228e06741f4ab5</string>
<key>issue_context_kind</key><string>function</string>
<key>issue_context</key><string>test_cast</string>
<key>issue_hash_function_offset</key><string>2</string>
// CHECK: analyzer-display-progress.cpp SomeOtherStruct::f() : {{[0-9]+}}
// CHECK: analyzer-display-progress.cpp ns::SomeStruct::f(int) : {{[0-9]+}}
// CHECK: analyzer-display-progress.cpp ns::SomeStruct::f(float, ::SomeStruct) : {{[0-9]+}}
-// CHECK: analyzer-display-progress.cpp ns::SomeStruct::f(float, struct ns::SomeStruct) : {{[0-9]+}}
+// CHECK: analyzer-display-progress.cpp ns::SomeStruct::f(float, SomeStruct) : {{[0-9]+}}
// CHECK: [B2 (ENTRY)]
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B1.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B1.2], A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: a
-// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 5: const A &b = a;
-// WARNINGS-NEXT: 6: A() (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 6: A() (CXXConstructExpr, [B1.9], class A)
+// WARNINGS-NEXT: 6: A() (CXXConstructExpr, A)
+// ANALYZER-NEXT: 6: A() (CXXConstructExpr, [B1.9], A)
// CHECK-NEXT: 7: [B1.6] (BindTemporary)
-// CHECK-NEXT: 8: [B1.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 8: [B1.7] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 9: [B1.8]
// CHECK: 10: const A &c = A();
// CHECK: 11: [B1.10].~A() (Implicit destructor)
// CHECK: [B2 (ENTRY)]
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
-// WARNINGS-NEXT: 1: A() (CXXConstructExpr, class A)
-// CXX98-ANALYZER-NEXT: 1: A() (CXXConstructExpr, [B1.2], class A)
-// CXX11-ANALYZER-NEXT: 1: A() (CXXConstructExpr, [B1.3], class A)
+// WARNINGS-NEXT: 1: A() (CXXConstructExpr, A)
+// CXX98-ANALYZER-NEXT: 1: A() (CXXConstructExpr, [B1.2], A)
+// CXX11-ANALYZER-NEXT: 1: A() (CXXConstructExpr, [B1.3], A)
// CHECK-NEXT: 2: [B1.1] (BindTemporary)
// CXX98-NEXT: 3: [B1.2].x
// CXX98-NEXT: 4: [B1.3]
// CHECK: [B2 (ENTRY)]
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
-// WARNINGS-NEXT: 1: A() (CXXConstructExpr, class A)
-// CXX98-ANALYZER-NEXT: 1: A() (CXXConstructExpr, [B1.2], class A)
-// CXX11-ANALYZER-NEXT: 1: A() (CXXConstructExpr, [B1.3], class A)
+// WARNINGS-NEXT: 1: A() (CXXConstructExpr, A)
+// CXX98-ANALYZER-NEXT: 1: A() (CXXConstructExpr, [B1.2], A)
+// CXX11-ANALYZER-NEXT: 1: A() (CXXConstructExpr, [B1.3], A)
// CHECK-NEXT: 2: [B1.1] (BindTemporary)
// CXX98-NEXT: 3: A::x
// CXX98-NEXT: 4: &[B1.3]
// CHECK: [B2 (ENTRY)]
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
-// WARNINGS-NEXT: 1: A() (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: A() (CXXConstructExpr, [B1.4], class A)
+// WARNINGS-NEXT: 1: A() (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: A() (CXXConstructExpr, [B1.4], A)
// CHECK-NEXT: 2: [B1.1] (BindTemporary)
-// CHECK-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 4: [B1.3]
// CHECK-NEXT: 5: {[B1.4]}
// CHECK-NEXT: 6: B b = {A()};
-// WARNINGS-NEXT: 7: A() (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 7: A() (CXXConstructExpr, [B1.10], class A)
+// WARNINGS-NEXT: 7: A() (CXXConstructExpr, A)
+// ANALYZER-NEXT: 7: A() (CXXConstructExpr, [B1.10], A)
// CHECK-NEXT: 8: [B1.7] (BindTemporary)
-// CHECK-NEXT: 9: [B1.8] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 9: [B1.8] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 10: [B1.9]
// CHECK-NEXT: 11: {[B1.10]}
-// WARNINGS-NEXT: 12: A() (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 12: A() (CXXConstructExpr, [B1.15], class A)
+// WARNINGS-NEXT: 12: A() (CXXConstructExpr, A)
+// ANALYZER-NEXT: 12: A() (CXXConstructExpr, [B1.15], A)
// CHECK-NEXT: 13: [B1.12] (BindTemporary)
-// CHECK-NEXT: 14: [B1.13] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 14: [B1.13] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 15: [B1.14]
// CHECK-NEXT: 16: {[B1.15]}
// CHECK-NEXT: 17: {[B1.10], [B1.15]}
// CXX11: [B2 (ENTRY)]
// CXX11-NEXT: Succs (1): B1
// CXX11: [B1]
-// CXX11-WARNINGS-NEXT: 1: A() (CXXConstructExpr, class A)
-// CXX11-ANALYZER-NEXT: 1: A() (CXXConstructExpr, [B1.2], [B1.4], class A)
+// CXX11-WARNINGS-NEXT: 1: A() (CXXConstructExpr, A)
+// CXX11-ANALYZER-NEXT: 1: A() (CXXConstructExpr, [B1.2], [B1.4], A)
// CXX11-NEXT: 2: [B1.1] (BindTemporary)
-// CXX11-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const class A)
+// CXX11-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const A)
// CXX11-NEXT: 4: [B1.3]
-// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, const class A)
-// CXX11-WARNINGS-NEXT: 6: A() (CXXConstructExpr, class A)
-// CXX11-ANALYZER-NEXT: 6: A() (CXXConstructExpr, [B1.7], [B1.9], class A)
+// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, const A)
+// CXX11-WARNINGS-NEXT: 6: A() (CXXConstructExpr, A)
+// CXX11-ANALYZER-NEXT: 6: A() (CXXConstructExpr, [B1.7], [B1.9], A)
// CXX11-NEXT: 7: [B1.6] (BindTemporary)
-// CXX11-NEXT: 8: [B1.7] (ImplicitCastExpr, NoOp, const class A)
+// CXX11-NEXT: 8: [B1.7] (ImplicitCastExpr, NoOp, const A)
// CXX11-NEXT: 9: [B1.8]
-// CXX11-NEXT: 10: [B1.9] (CXXConstructExpr, const class A)
+// CXX11-NEXT: 10: [B1.9] (CXXConstructExpr, const A)
// FIXME: Why does it look as if the initializer list consumes uncopied objects?
// CXX11-NEXT: 11: {[B1.2], [B1.7]}
// CXX11-NEXT: 12: [B1.11] (BindTemporary)
// CXX11-NEXT: 15: C c = {{[{][{]}}A(), A(){{[}][}]}};
// CXX11-NEXT: 16: ~A() (Temporary object destructor)
// CXX11-NEXT: 17: ~A() (Temporary object destructor)
-// CXX11-WARNINGS-NEXT: 18: A() (CXXConstructExpr, class A)
-// CXX11-ANALYZER-NEXT: 18: A() (CXXConstructExpr, [B1.19], [B1.21], class A)
+// CXX11-WARNINGS-NEXT: 18: A() (CXXConstructExpr, A)
+// CXX11-ANALYZER-NEXT: 18: A() (CXXConstructExpr, [B1.19], [B1.21], A)
// CXX11-NEXT: 19: [B1.18] (BindTemporary)
-// CXX11-NEXT: 20: [B1.19] (ImplicitCastExpr, NoOp, const class A)
+// CXX11-NEXT: 20: [B1.19] (ImplicitCastExpr, NoOp, const A)
// CXX11-NEXT: 21: [B1.20]
-// CXX11-NEXT: 22: [B1.21] (CXXConstructExpr, const class A)
-// CXX11-WARNINGS-NEXT: 23: A() (CXXConstructExpr, class A)
-// CXX11-ANALYZER-NEXT: 23: A() (CXXConstructExpr, [B1.24], [B1.26], class A)
+// CXX11-NEXT: 22: [B1.21] (CXXConstructExpr, const A)
+// CXX11-WARNINGS-NEXT: 23: A() (CXXConstructExpr, A)
+// CXX11-ANALYZER-NEXT: 23: A() (CXXConstructExpr, [B1.24], [B1.26], A)
// CXX11-NEXT: 24: [B1.23] (BindTemporary)
-// CXX11-NEXT: 25: [B1.24] (ImplicitCastExpr, NoOp, const class A)
+// CXX11-NEXT: 25: [B1.24] (ImplicitCastExpr, NoOp, const A)
// CXX11-NEXT: 26: [B1.25]
-// CXX11-NEXT: 27: [B1.26] (CXXConstructExpr, const class A)
+// CXX11-NEXT: 27: [B1.26] (CXXConstructExpr, const A)
// FIXME: Why does it look as if the initializer list consumes uncopied objects?
// CXX11-NEXT: 28: {[B1.19], [B1.24]}
// CXX11-NEXT: 29: [B1.28] (BindTemporary)
// CXX11-NEXT: 30: [B1.29]
// CXX11-NEXT: 31: {[B1.30]}
-// CXX11-WARNINGS-NEXT: 32: A() (CXXConstructExpr, class A)
-// CXX11-ANALYZER-NEXT: 32: A() (CXXConstructExpr, [B1.33], [B1.35], class A)
+// CXX11-WARNINGS-NEXT: 32: A() (CXXConstructExpr, A)
+// CXX11-ANALYZER-NEXT: 32: A() (CXXConstructExpr, [B1.33], [B1.35], A)
// CXX11-NEXT: 33: [B1.32] (BindTemporary)
-// CXX11-NEXT: 34: [B1.33] (ImplicitCastExpr, NoOp, const class A)
+// CXX11-NEXT: 34: [B1.33] (ImplicitCastExpr, NoOp, const A)
// CXX11-NEXT: 35: [B1.34]
-// CXX11-NEXT: 36: [B1.35] (CXXConstructExpr, const class A)
-// CXX11-WARNINGS-NEXT: 37: A() (CXXConstructExpr, class A)
-// CXX11-ANALYZER-NEXT: 37: A() (CXXConstructExpr, [B1.38], [B1.40], class A)
+// CXX11-NEXT: 36: [B1.35] (CXXConstructExpr, const A)
+// CXX11-WARNINGS-NEXT: 37: A() (CXXConstructExpr, A)
+// CXX11-ANALYZER-NEXT: 37: A() (CXXConstructExpr, [B1.38], [B1.40], A)
// CXX11-NEXT: 38: [B1.37] (BindTemporary)
-// CXX11-NEXT: 39: [B1.38] (ImplicitCastExpr, NoOp, const class A)
+// CXX11-NEXT: 39: [B1.38] (ImplicitCastExpr, NoOp, const A)
// CXX11-NEXT: 40: [B1.39]
-// CXX11-NEXT: 41: [B1.40] (CXXConstructExpr, const class A)
+// CXX11-NEXT: 41: [B1.40] (CXXConstructExpr, const A)
// FIXME: Why does it look as if the initializer list consumes uncopied objects?
// CXX11-NEXT: 42: {[B1.33], [B1.38]}
// CXX11-NEXT: 43: [B1.42] (BindTemporary)
// CHECK: [B2 (ENTRY)]
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
-// WARNINGS-NEXT: 1: A() (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: A() (CXXConstructExpr, [B1.2], [B1.4], class A)
+// WARNINGS-NEXT: 1: A() (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: A() (CXXConstructExpr, [B1.2], [B1.4], A)
// CHECK-NEXT: 2: [B1.1] (BindTemporary)
-// CHECK-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 4: [B1.3]
-// CHECK-NEXT: 5: [B1.4] (CXXConstructExpr, class A)
-// WARNINGS-NEXT: 6: A() (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 6: A() (CXXConstructExpr, [B1.7], [B1.9], class A)
+// CHECK-NEXT: 5: [B1.4] (CXXConstructExpr, A)
+// WARNINGS-NEXT: 6: A() (CXXConstructExpr, A)
+// ANALYZER-NEXT: 6: A() (CXXConstructExpr, [B1.7], [B1.9], A)
// CHECK-NEXT: 7: [B1.6] (BindTemporary)
-// CHECK-NEXT: 8: [B1.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 8: [B1.7] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 9: [B1.8]
-// CHECK-NEXT: 10: [B1.9] (CXXConstructExpr, class A)
-// WARNINGS-NEXT: 11: A() (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 11: A() (CXXConstructExpr, [B1.12], [B1.14], class A)
+// CHECK-NEXT: 10: [B1.9] (CXXConstructExpr, A)
+// WARNINGS-NEXT: 11: A() (CXXConstructExpr, A)
+// ANALYZER-NEXT: 11: A() (CXXConstructExpr, [B1.12], [B1.14], A)
// CHECK-NEXT: 12: [B1.11] (BindTemporary)
-// CHECK-NEXT: 13: [B1.12] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 13: [B1.12] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 14: [B1.13]
-// CHECK-NEXT: 15: [B1.14] (CXXConstructExpr, class A)
+// CHECK-NEXT: 15: [B1.14] (CXXConstructExpr, A)
// FIXME: Why does it look as if the initializer list consumes uncopied objects?
// CHECK-NEXT: 16: {[B1.7], [B1.12]}
// FIXME: Why does it look as if the initializer list consumes uncopied objects?
// CHECK-NEXT: 19: ~A() (Temporary object destructor)
// CHECK-NEXT: 20: ~A() (Temporary object destructor)
// CHECK-NEXT: 21: ~A() (Temporary object destructor)
-// WARNINGS-NEXT: 22: A() (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 22: A() (CXXConstructExpr, [B1.23], [B1.25], class A)
+// WARNINGS-NEXT: 22: A() (CXXConstructExpr, A)
+// ANALYZER-NEXT: 22: A() (CXXConstructExpr, [B1.23], [B1.25], A)
// CHECK-NEXT: 23: [B1.22] (BindTemporary)
-// CHECK-NEXT: 24: [B1.23] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 24: [B1.23] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 25: [B1.24]
-// CHECK-NEXT: 26: [B1.25] (CXXConstructExpr, class A)
-// WARNINGS-NEXT: 27: A() (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 27: A() (CXXConstructExpr, [B1.28], [B1.30], class A)
+// CHECK-NEXT: 26: [B1.25] (CXXConstructExpr, A)
+// WARNINGS-NEXT: 27: A() (CXXConstructExpr, A)
+// ANALYZER-NEXT: 27: A() (CXXConstructExpr, [B1.28], [B1.30], A)
// CHECK-NEXT: 28: [B1.27] (BindTemporary)
-// CHECK-NEXT: 29: [B1.28] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 29: [B1.28] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 30: [B1.29]
-// CHECK-NEXT: 31: [B1.30] (CXXConstructExpr, class A)
-// WARNINGS-NEXT: 32: A() (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 32: A() (CXXConstructExpr, [B1.33], [B1.35], class A)
+// CHECK-NEXT: 31: [B1.30] (CXXConstructExpr, A)
+// WARNINGS-NEXT: 32: A() (CXXConstructExpr, A)
+// ANALYZER-NEXT: 32: A() (CXXConstructExpr, [B1.33], [B1.35], A)
// CHECK-NEXT: 33: [B1.32] (BindTemporary)
-// CHECK-NEXT: 34: [B1.33] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 34: [B1.33] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 35: [B1.34]
-// CHECK-NEXT: 36: [B1.35] (CXXConstructExpr, class A)
+// CHECK-NEXT: 36: [B1.35] (CXXConstructExpr, A)
// FIXME: Why does it look as if the initializer list consumes uncopied objects?
// CHECK-NEXT: 37: {[B1.28], [B1.33]}
// FIXME: Why does it look as if the initializer list consumes uncopied objects?
// CHECK-NEXT: 38: {[B1.23], {[B1.28], [B1.33]}}
-// WARNINGS-NEXT: 39: A() (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 39: A() (CXXConstructExpr, [B1.40], [B1.42], class A)
+// WARNINGS-NEXT: 39: A() (CXXConstructExpr, A)
+// ANALYZER-NEXT: 39: A() (CXXConstructExpr, [B1.40], [B1.42], A)
// CHECK-NEXT: 40: [B1.39] (BindTemporary)
-// CHECK-NEXT: 41: [B1.40] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 41: [B1.40] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 42: [B1.41]
-// CHECK-NEXT: 43: [B1.42] (CXXConstructExpr, class A)
-// WARNINGS-NEXT: 44: A() (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 44: A() (CXXConstructExpr, [B1.45], [B1.47], class A)
+// CHECK-NEXT: 43: [B1.42] (CXXConstructExpr, A)
+// WARNINGS-NEXT: 44: A() (CXXConstructExpr, A)
+// ANALYZER-NEXT: 44: A() (CXXConstructExpr, [B1.45], [B1.47], A)
// CHECK-NEXT: 45: [B1.44] (BindTemporary)
-// CHECK-NEXT: 46: [B1.45] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 46: [B1.45] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 47: [B1.46]
-// CHECK-NEXT: 48: [B1.47] (CXXConstructExpr, class A)
-// WARNINGS-NEXT: 49: A() (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 49: A() (CXXConstructExpr, [B1.50], [B1.52], class A)
+// CHECK-NEXT: 48: [B1.47] (CXXConstructExpr, A)
+// WARNINGS-NEXT: 49: A() (CXXConstructExpr, A)
+// ANALYZER-NEXT: 49: A() (CXXConstructExpr, [B1.50], [B1.52], A)
// CHECK-NEXT: 50: [B1.49] (BindTemporary)
-// CHECK-NEXT: 51: [B1.50] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 51: [B1.50] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 52: [B1.51]
-// CHECK-NEXT: 53: [B1.52] (CXXConstructExpr, class A)
+// CHECK-NEXT: 53: [B1.52] (CXXConstructExpr, A)
// FIXME: Why does it look as if the initializer list consumes uncopied objects?
// CHECK-NEXT: 54: {[B1.45], [B1.50]}
// FIXME: Why does it look as if the initializer list consumes uncopied objects?
// CHECK: [B2 (ENTRY)]
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A[2])
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B1.2], class A[2])
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A[2])
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B1.2], A[2])
// CHECK-NEXT: 2: A a[2];
-// WARNINGS-NEXT: 3: (CXXConstructExpr, class A[0])
-// ANALYZER-NEXT: 3: (CXXConstructExpr, [B1.4], class A[0])
+// WARNINGS-NEXT: 3: (CXXConstructExpr, A[0])
+// ANALYZER-NEXT: 3: (CXXConstructExpr, [B1.4], A[0])
// CHECK-NEXT: 4: A b[0];
// CHECK-NEXT: 5: [B1.2].~A[2]() (Implicit destructor)
// CHECK-NEXT: Preds (1): B2
// CHECK: [B2 (ENTRY)]
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B1.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B1.2], A)
// CHECK-NEXT: 2: A a;
-// WARNINGS-NEXT: 3: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 3: (CXXConstructExpr, [B1.4], class A)
+// WARNINGS-NEXT: 3: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 3: (CXXConstructExpr, [B1.4], A)
// CHECK-NEXT: 4: A c;
-// WARNINGS-NEXT: 5: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 5: (CXXConstructExpr, [B1.6], class A)
+// WARNINGS-NEXT: 5: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 5: (CXXConstructExpr, [B1.6], A)
// CHECK-NEXT: 6: A d;
// CHECK-NEXT: 7: [B1.6].~A() (Implicit destructor)
// CHECK-NEXT: 8: [B1.4].~A() (Implicit destructor)
-// WARNINGS-NEXT: 9: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 9: (CXXConstructExpr, [B1.10], class A)
+// WARNINGS-NEXT: 9: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 9: (CXXConstructExpr, [B1.10], A)
// CHECK: 10: A b;
// CHECK: 11: [B1.10].~A() (Implicit destructor)
// CHECK: 12: [B1.2].~A() (Implicit destructor)
// CHECK: [B4 (ENTRY)]
// CHECK-NEXT: Succs (1): B3
// CHECK: [B1]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B1.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B1.2], A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B1.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B3.4].~A() (Implicit destructor)
// CHECK-NEXT: Preds (1): B3
// CHECK-NEXT: Succs (1): B0
// CHECK: [B3]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], A)
// CHECK-NEXT: 2: A a;
-// WARNINGS-NEXT: 3: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 3: (CXXConstructExpr, [B3.4], class A)
+// WARNINGS-NEXT: 3: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 3: (CXXConstructExpr, [B3.4], A)
// CHECK-NEXT: 4: A b;
// CHECK-NEXT: 5: UV
// CHECK-NEXT: 6: [B3.5] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: Succs (1): B7
// CHECK: [B1]
// CHECK: l1:
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B1.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B1.2], A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B1.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B6.2].~A() (Implicit destructor)
// CHECK-NEXT: Preds (2): B2 B3
// CHECK-NEXT: Succs (1): B0
// CHECK: [B2]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B2.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B2.2], A)
// CHECK-NEXT: 2: A b;
// CHECK-NEXT: 3: [B2.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B6.4].~A() (Implicit destructor)
// CHECK-NEXT: Succs (1): B6
// CHECK: [B6]
// CHECK: l0:
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B6.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B6.2], A)
// CHECK-NEXT: 2: A b;
-// WARNINGS-NEXT: 3: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 3: (CXXConstructExpr, [B6.4], class A)
+// WARNINGS-NEXT: 3: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 3: (CXXConstructExpr, [B6.4], A)
// CHECK-NEXT: 4: A a;
// CHECK-NEXT: 5: UV
// CHECK-NEXT: 6: [B6.5] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: Preds (2): B7 B5
// CHECK-NEXT: Succs (2): B5 B4
// CHECK: [B7]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B7.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B7.2], A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: Preds (1): B8
// CHECK-NEXT: Succs (1): B6
// CHECK-NEXT: Preds (2): B2 B3
// CHECK-NEXT: Succs (1): B0
// CHECK: [B2]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B2.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B2.2], A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B2.2].~A() (Implicit destructor)
// CHECK-NEXT: Preds (1): B4
// CHECK-NEXT: Succs (1): B1
// CHECK: [B3]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
// CHECK-NEXT: Preds (1): B4
// CHECK-NEXT: Succs (1): B1
// CHECK: [B4]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B4.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B4.2], A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: a
// CHECK-NEXT: 4: [B4.3] (ImplicitCastExpr, NoOp, const class A)
-// WARNINGS-NEXT: 5: [B4.4] (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 5: [B4.4] (CXXConstructExpr, [B4.6], class A)
+// WARNINGS-NEXT: 5: [B4.4] (CXXConstructExpr, A)
+// ANALYZER-NEXT: 5: [B4.4] (CXXConstructExpr, [B4.6], A)
// CHECK-NEXT: 6: A b = a;
// CHECK-NEXT: 7: b
// CHECK-NEXT: 8: [B4.7] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Succs (1): B8
// CHECK: [B1]
// CHECK-NEXT: 1: [B8.6].~A() (Implicit destructor)
-// WARNINGS-NEXT: 2: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 2: (CXXConstructExpr, [B1.3], class A)
+// WARNINGS-NEXT: 2: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 2: (CXXConstructExpr, [B1.3], A)
// CHECK-NEXT: 3: A e;
// CHECK-NEXT: 4: [B1.3].~A() (Implicit destructor)
// CHECK-NEXT: 5: [B8.2].~A() (Implicit destructor)
// CHECK-NEXT: Preds (2): B2 B5
// CHECK-NEXT: Succs (1): B0
// CHECK: [B2]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B2.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B2.2], A)
// CHECK-NEXT: 2: A d;
// CHECK-NEXT: 3: [B2.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B4.2].~A() (Implicit destructor)
// CHECK-NEXT: Preds (1): B4
// CHECK-NEXT: Succs (1): B0
// CHECK: [B4]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B4.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B4.2], A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: UV
// CHECK-NEXT: 4: [B4.3] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: Preds (1): B8
// CHECK-NEXT: Succs (2): B3 B2
// CHECK: [B5]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B5.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B5.2], A)
// CHECK-NEXT: 2: A d;
// CHECK-NEXT: 3: [B5.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B7.2].~A() (Implicit destructor)
// CHECK-NEXT: Preds (1): B7
// CHECK-NEXT: Succs (1): B0
// CHECK: [B7]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B7.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B7.2], A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: UV
// CHECK-NEXT: 4: [B7.3] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: Preds (1): B8
// CHECK-NEXT: Succs (2): B6 B5
// CHECK: [B8]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B8.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B8.2], A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: a
// CHECK-NEXT: 4: [B8.3] (ImplicitCastExpr, NoOp, const class A)
-// WARNINGS-NEXT: 5: [B8.4] (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 5: [B8.4] (CXXConstructExpr, [B8.6], class A)
+// WARNINGS-NEXT: 5: [B8.4] (CXXConstructExpr, A)
+// ANALYZER-NEXT: 5: [B8.4] (CXXConstructExpr, [B8.6], A)
// CHECK-NEXT: 6: A b = a;
// CHECK-NEXT: 7: b
// CHECK-NEXT: 8: [B8.7] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Preds (1): B3
// CHECK-NEXT: Succs (1): B4
// CHECK: [B3]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B4.4].~A() (Implicit destructor)
// CHECK: [B4]
// CHECK-NEXT: 1: a
// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
-// WARNINGS-NEXT: 3: [B4.2] (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 3: [B4.2] (CXXConstructExpr, [B4.4], class A)
+// WARNINGS-NEXT: 3: [B4.2] (CXXConstructExpr, A)
+// ANALYZER-NEXT: 3: [B4.2] (CXXConstructExpr, [B4.4], A)
// CHECK-NEXT: 4: A b = a;
// CHECK-NEXT: 5: b
// CHECK-NEXT: 6: [B4.5] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Preds (2): B2 B5
// CHECK-NEXT: Succs (2): B3 B1
// CHECK: [B5]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B5.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B5.2], A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: Preds (1): B6
// CHECK-NEXT: Succs (1): B4
// CHECK-NEXT: Succs (1): B11
// CHECK: [B1]
// CHECK-NEXT: 1: [B10.4].~A() (Implicit destructor)
-// WARNINGS-NEXT: 2: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 2: (CXXConstructExpr, [B1.3], class A)
+// WARNINGS-NEXT: 2: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 2: (CXXConstructExpr, [B1.3], A)
// CHECK-NEXT: 3: A e;
// CHECK-NEXT: 4: [B1.3].~A() (Implicit destructor)
// CHECK-NEXT: 5: [B11.2].~A() (Implicit destructor)
// CHECK-NEXT: Preds (2): B3 B6
// CHECK-NEXT: Succs (1): B10
// CHECK: [B3]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], A)
// CHECK-NEXT: 2: A d;
// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B9.2].~A() (Implicit destructor)
// CHECK: Preds (1): B9
// CHECK-NEXT: Succs (1): B1
// CHECK: [B9]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B9.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B9.2], A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: UV
// CHECK-NEXT: 4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK: [B10]
// CHECK-NEXT: 1: a
// CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const class A)
-// WARNINGS-NEXT: 3: [B10.2] (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 3: [B10.2] (CXXConstructExpr, [B10.4], class A)
+// WARNINGS-NEXT: 3: [B10.2] (CXXConstructExpr, A)
+// ANALYZER-NEXT: 3: [B10.2] (CXXConstructExpr, [B10.4], A)
// CHECK-NEXT: 4: A b = a;
// CHECK-NEXT: 5: b
// CHECK-NEXT: 6: [B10.5] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Preds (2): B2 B11
// CHECK-NEXT: Succs (2): B9 B1
// CHECK: [B11]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B11.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B11.2], A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: Preds (1): B12
// CHECK-NEXT: Succs (1): B10
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: Succs (2): B3 B0
// CHECK: [B2]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B2.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B2.2], A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: [B2.2].~A() (Implicit destructor)
// CHECK-NEXT: Preds (2): B3 B4
// CHECK: [B12 (ENTRY)]
// CHECK-NEXT: Succs (1): B11
// CHECK: [B1]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B1.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B1.2], A)
// CHECK-NEXT: 2: A d;
// CHECK-NEXT: 3: [B1.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B11.2].~A() (Implicit destructor)
// CHECK-NEXT: Preds (2): B3 B6
// CHECK-NEXT: Succs (2): B10 B1
// CHECK: [B3]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B9.2].~A() (Implicit destructor)
// CHECK: Preds (1): B9
// CHECK-NEXT: Succs (1): B1
// CHECK: [B9]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B9.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B9.2], A)
// CHECK-NEXT: 2: A b;
// CHECK-NEXT: 3: UV
// CHECK-NEXT: 4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: Succs (1): B9
// CHECK: [B11]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B11.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B11.2], A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: Preds (1): B12
// CHECK-NEXT: Succs (1): B9
// CHECK-NEXT: Preds (2): B3 B2
// CHECK-NEXT: Succs (1): B0
// CHECK: [B2]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B2.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B2.2], A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: a
// CHECK-NEXT: 4: [B2.3] (ImplicitCastExpr, NoOp, const class A)
-// CHECK-NEXT: 5: [B2.4] (CXXConstructExpr, class A)
+// CHECK-NEXT: 5: [B2.4] (CXXConstructExpr, A)
// CHECK-NEXT: 6: A b = a;
// CHECK-NEXT: 7: b
// CHECK-NEXT: 8: [B2.7] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Preds (1): B4
// CHECK-NEXT: Succs (1): B1
// CHECK: [B3]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
// CHECK-NEXT: Succs (1): B1
// CHECK-NEXT: Succs (1): B2
// CHECK: [B1]
// CHECK-NEXT: 1: [B2.6].~A() (Implicit destructor)
-// WARNINGS-NEXT: 2: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 2: (CXXConstructExpr, [B1.3], class A)
+// WARNINGS-NEXT: 2: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 2: (CXXConstructExpr, [B1.3], A)
// CHECK-NEXT: 3: A g;
// CHECK-NEXT: 4: [B1.3].~A() (Implicit destructor)
// CHECK-NEXT: 5: [B2.2].~A() (Implicit destructor)
// CHECK-NEXT: Preds (3): B3 B7 B2
// CHECK-NEXT: Succs (1): B0
// CHECK: [B2]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B2.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B2.2], A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: a
// CHECK-NEXT: 4: [B2.3] (ImplicitCastExpr, NoOp, const class A)
-// CHECK-NEXT: 5: [B2.4] (CXXConstructExpr, class A)
+// CHECK-NEXT: 5: [B2.4] (CXXConstructExpr, A)
// CHECK-NEXT: 6: A b = a;
// CHECK-NEXT: 7: b
// CHECK-NEXT: 8: [B2.7] (ImplicitCastExpr, NoOp, const class A)
// CHECK: Preds (2): B2 B4
// CHECK-NEXT: Succs (1): B1
// CHECK: [B4]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B4.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B4.2], A)
// CHECK-NEXT: 2: A f;
// CHECK-NEXT: 3: [B4.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B8.2].~A() (Implicit destructor)
// CHECK-NEXT: Succs (1): B1
// CHECK: [B8]
// CHECK: case 0:
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B8.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B8.2], A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: UV
// CHECK-NEXT: 4: [B8.3] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: Preds (1): B3
// CHECK-NEXT: Succs (1): B4
// CHECK: [B3]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B4.4].~A() (Implicit destructor)
// CHECK: [B4]
// CHECK-NEXT: 1: a
// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
-// WARNINGS-NEXT: 3: [B4.2] (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 3: [B4.2] (CXXConstructExpr, [B4.4], class A)
+// WARNINGS-NEXT: 3: [B4.2] (CXXConstructExpr, A)
+// ANALYZER-NEXT: 3: [B4.2] (CXXConstructExpr, [B4.4], A)
// CHECK-NEXT: 4: A b = a;
// CHECK-NEXT: 5: b
// CHECK-NEXT: 6: [B4.5] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Preds (2): B2 B5
// CHECK-NEXT: Succs (2): B3 B1
// CHECK: [B5]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B5.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B5.2], A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: Preds (1): B6
// CHECK-NEXT: Succs (1): B4
// CHECK-NEXT: 3: *[B3.2]
// CHECK-NEXT: 4: [B3.3] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: 5: int n
-// WARNINGS-NEXT: 6: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 6: (CXXConstructExpr, [B3.7], class A)
+// WARNINGS-NEXT: 6: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 6: (CXXConstructExpr, [B3.7], A)
// CHECK-NEXT: 7: A c;
// CHECK-NEXT: 8: [B3.7].~A() (Implicit destructor)
// CHECK-NEXT: Preds (1): B1
// CHECK: [B1]
// CHECK-NEXT: 1: [B10.4].~A() (Implicit destructor)
// CHECK-NEXT: 2: [B11.4].~A() (Implicit destructor)
-// WARNINGS-NEXT: 3: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 3: (CXXConstructExpr, [B1.4], class A)
+// WARNINGS-NEXT: 3: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 3: (CXXConstructExpr, [B1.4], A)
// CHECK-NEXT: 4: A f;
// CHECK-NEXT: 5: [B1.4].~A() (Implicit destructor)
// CHECK-NEXT: 6: [B11.2].~A() (Implicit destructor)
// CHECK-NEXT: Preds (2): B3 B6
// CHECK-NEXT: Succs (1): B10
// CHECK: [B3]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], A)
// CHECK-NEXT: 2: A e;
// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B9.2].~A() (Implicit destructor)
// CHECK: Preds (1): B9
// CHECK-NEXT: Succs (1): B1
// CHECK: [B9]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B9.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B9.2], A)
// CHECK-NEXT: 2: A d;
// CHECK-NEXT: 3: UV
// CHECK-NEXT: 4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK: [B10]
// CHECK-NEXT: 1: b
// CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const class A)
-// WARNINGS-NEXT: 3: [B10.2] (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 3: [B10.2] (CXXConstructExpr, [B10.4], class A)
+// WARNINGS-NEXT: 3: [B10.2] (CXXConstructExpr, A)
+// ANALYZER-NEXT: 3: [B10.2] (CXXConstructExpr, [B10.4], A)
// CHECK-NEXT: 4: A c = b;
// CHECK-NEXT: 5: c
// CHECK-NEXT: 6: [B10.5] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Preds (2): B2 B11
// CHECK-NEXT: Succs (2): B9 B1
// CHECK: [B11]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B11.2], class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B11.2], A)
// CHECK-NEXT: 2: A a;
-// WARNINGS-NEXT: 3: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 3: (CXXConstructExpr, [B11.4], class A)
+// WARNINGS-NEXT: 3: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 3: (CXXConstructExpr, [B11.4], A)
// CHECK-NEXT: 4: A b;
// CHECK-NEXT: Preds (1): B12
// CHECK-NEXT: Succs (1): B10
// CHECK: [B1]
// CHECK-NEXT: 1: s
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const struct StructWithCopyConstructor)
-// CHECK-NEXT: 3: [B1.2] (CXXConstructExpr, const struct StructWithCopyConstructor)
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const StructWithCopyConstructor)
+// CHECK-NEXT: 3: [B1.2] (CXXConstructExpr, const StructWithCopyConstructor)
// CHECK-NEXT: 4: ^{ }
// CHECK-NEXT: 5: (void)([B1.4]) (CStyleCastExpr, ToVoid, void)
// CHECK-NEXT: Preds (1): B2
// CHECK: [B1]
// CHECK-NEXT: 1: 5
-// WARNINGS-NEXT: 2: [B1.1] (CXXConstructExpr, struct StructWithCopyConstructor)
-// ANALYZER-NEXT: 2: [B1.1] (CXXConstructExpr, [B1.3], struct StructWithCopyConstructor)
+// WARNINGS-NEXT: 2: [B1.1] (CXXConstructExpr, StructWithCopyConstructor)
+// ANALYZER-NEXT: 2: [B1.1] (CXXConstructExpr, [B1.3], StructWithCopyConstructor)
// CHECK-NEXT: 3: StructWithCopyConstructor s(5) __attribute__((blocks("byref")));
// CHECK-NEXT: 4: ^{ }
// CHECK-NEXT: 5: (void)([B1.4]) (CStyleCastExpr, ToVoid, void)
void OutOfLine();
X &operator=(int) {
- clang_analyzer_hashDump(5); // expected-warning {{debug.ExprInspection$class AA::X & AA::X::operator=(int)$29$clang_analyzer_hashDump(5);$Category}}
+ clang_analyzer_hashDump(5); // expected-warning {{debug.ExprInspection$X & AA::X::operator=(int)$29$clang_analyzer_hashDump(5);$Category}}
return *this;
}
const auto &C = dyn_cast<DEVICE Circle>(S);
clang_analyzer_printState();
// X86-CHECK-SUPPRESSED: "dynamic_types": [
- // X86-CHECK-SUPPRESSED-NEXT: { "region": "SymRegion{reg_$0<const struct clang::Shape & S>}", "dyn_type": "const __attribute__((address_space(3))) class clang::Circle &", "sub_classable": true }
+ // X86-CHECK-SUPPRESSED-NEXT: { "region": "SymRegion{reg_$0<const Shape & S>}", "dyn_type": "const __attribute__((address_space(3))) class clang::Circle &", "sub_classable": true }
(void)C;
}
#endif
// expected-warning@-3 {{Dereference of null pointer}}
clang_analyzer_printState();
// X86-CHECK: "dynamic_types": [
- // X86-CHECK-NEXT: { "region": "SymRegion{reg_$0<const struct clang::Shape & S>}", "dyn_type": "const __attribute__((address_space(3))) class clang::Circle &", "sub_classable": true }
+ // X86-CHECK-NEXT: { "region": "SymRegion{reg_$0<const Shape & S>}", "dyn_type": "const __attribute__((address_space(3))) class clang::Circle &", "sub_classable": true }
(void)C;
}
#endif
clang_analyzer_printState();
// CHECK: "dynamic_types": [
- // CHECK-NEXT: { "region": "SymRegion{reg_$0<const struct clang::Shape * S>}", "dyn_type": "const class clang::Circle", "sub_classable": true }
+ // CHECK-NEXT: { "region": "SymRegion{reg_$0<const Shape * S>}", "dyn_type": "const class clang::Circle", "sub_classable": true }
// CHECK-NEXT: ],
// CHECK-NEXT: "dynamic_casts": [
- // CHECK: { "region": "SymRegion{reg_$0<const struct clang::Shape * S>}", "casts": [
+ // CHECK: { "region": "SymRegion{reg_$0<const Shape * S>}", "casts": [
// CHECK-NEXT: { "from": "struct clang::Shape", "to": "class clang::Circle", "kind": "success" },
// CHECK-NEXT: { "from": "struct clang::Shape", "to": "class clang::Square", "kind": "fail" }
// CHECK-NEXT: ] }
// CHECK: void operatorNewWithConstructor()
// CHECK: 1: CFGNewAllocator(C *)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B1.3], class C)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B1.3], C)
// CHECK-NEXT: 3: new C([B1.2])
void operatorNewWithConstructor() {
new C();
// CHECK: void operatorNewWithConstructorWithOperatorNewWithContstructor()
// CHECK: 1: CFGNewAllocator(C *)
// CHECK-NEXT: 2: CFGNewAllocator(C *)
-// CHECK-NEXT: 3: (CXXConstructExpr, [B1.4], class C)
+// CHECK-NEXT: 3: (CXXConstructExpr, [B1.4], C)
// CHECK-NEXT: 4: new C([B1.3])
-// CHECK-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.6], class C)
+// CHECK-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.6], C)
// CHECK-NEXT: 6: new C([B1.5])
void operatorNewWithConstructorWithOperatorNewWithContstructor() {
new C(new C());
// CHECK: void operatorPlacementNewWithConstructorWithinPlacementArgument()
// CHECK: 1: CFGNewAllocator(C *)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B1.3], class C)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B1.3], C)
// CHECK-NEXT: 3: new C([B1.2])
// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, BitCast, void *)
// CHECK-NEXT: 5: CFGNewAllocator(C *)
-// CHECK-NEXT: 6: (CXXConstructExpr, [B1.7], class C)
+// CHECK-NEXT: 6: (CXXConstructExpr, [B1.7], C)
// CHECK-NEXT: 7: new ([B1.4]) C([B1.6])
void operatorPlacementNewWithConstructorWithinPlacementArgument() {
new (new C()) C();
namespace decl_stmt {
// CHECK: void simpleVariable()
-// CHECK: 1: (CXXConstructExpr, [B1.2], class C)
+// CHECK: 1: (CXXConstructExpr, [B1.2], C)
// CHECK-NEXT: 2: C c;
void simpleVariable() {
C c;
}
// CHECK: void simpleVariableWithBraces()
-// CHECK: 1: {} (CXXConstructExpr, [B1.2], class C)
+// CHECK: 1: {} (CXXConstructExpr, [B1.2], C)
// CHECK-NEXT: 2: C c{};
void simpleVariableWithBraces() {
C c{};
// CHECK: void simpleVariableWithConstructorArgument()
// CHECK: 1: 0
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NullToPointer, class C *)
-// CHECK-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.4], class C)
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NullToPointer, C *)
+// CHECK-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.4], C)
// CHECK-NEXT: 4: C c(0);
void simpleVariableWithConstructorArgument() {
C c(0);
// CHECK: void simpleVariableWithOperatorNewInConstructorArgument()
// CHECK: 1: CFGNewAllocator(C *)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B1.3], class C)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B1.3], C)
// CHECK-NEXT: 3: new C([B1.2])
-// CHECK-NEXT: 4: [B1.3] (CXXConstructExpr, [B1.5], class C)
+// CHECK-NEXT: 4: [B1.3] (CXXConstructExpr, [B1.5], C)
// CHECK-NEXT: 5: C c(new C());
void simpleVariableWithOperatorNewInConstructorArgument() {
C c(new C());
// CHECK: void simpleVariableWithOperatorNewInBraces()
// CHECK: 1: CFGNewAllocator(C *)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B1.3], class C)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B1.3], C)
// CHECK-NEXT: 3: new C([B1.2])
-// CHECK-NEXT: 4: {[B1.3]} (CXXConstructExpr, [B1.5], class C)
+// CHECK-NEXT: 4: {[B1.3]} (CXXConstructExpr, [B1.5], C)
// CHECK-NEXT: 5: C c{new C()};
void simpleVariableWithOperatorNewInBraces() {
C c{new C()};
// CHECK: void simpleVariableInitializedByValue()
// CHECK: 1: C::get
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class C (*)(void))
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, C (*)(void))
// CXX11-ELIDE-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.4], [B1.5])
// CXX11-NOELIDE-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.4])
// CXX11-NEXT: 4: [B1.3]
-// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.6], class C)
+// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.6], C)
// CXX11-NEXT: 6: C c = C::get();
// CXX17-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.4])
// CXX17-NEXT: 4: C c = C::get();
// CHECK: [B1]
// CXX11-NEXT: 1: [B4.2] ? [B2.5] : [B3.6]
// CXX11-NEXT: 2: [B1.1]
-// CXX11-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.4], class C)
+// CXX11-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.4], C)
// CXX11-NEXT: 4: C c = coin ? C::get() : C(0);
// CXX17-NEXT: 1: [B4.2] ? [B2.3] : [B3.4]
// CXX17-NEXT: 2: C c = coin ? C::get() : C(0);
// CHECK: [B2]
// CHECK-NEXT: 1: C::get
-// CHECK-NEXT: 2: [B2.1] (ImplicitCastExpr, FunctionToPointerDecay, class C (*)(void))
+// CHECK-NEXT: 2: [B2.1] (ImplicitCastExpr, FunctionToPointerDecay, C (*)(void))
// CXX11-ELIDE-NEXT: 3: [B2.2]() (CXXRecordTypedCall, [B2.4], [B2.5])
// CXX11-NOELIDE-NEXT: 3: [B2.2]() (CXXRecordTypedCall, [B2.4])
// CXX11-NEXT: 4: [B2.3]
-// CXX11-ELIDE-NEXT: 5: [B2.4] (CXXConstructExpr, [B1.2], [B1.3], class C)
-// CXX11-NOELIDE-NEXT: 5: [B2.4] (CXXConstructExpr, [B1.2], class C)
+// CXX11-ELIDE-NEXT: 5: [B2.4] (CXXConstructExpr, [B1.2], [B1.3], C)
+// CXX11-NOELIDE-NEXT: 5: [B2.4] (CXXConstructExpr, [B1.2], C)
// CXX17-NEXT: 3: [B2.2]()
// CHECK: [B3]
// CHECK-NEXT: 1: 0
-// CHECK-NEXT: 2: [B3.1] (ImplicitCastExpr, NullToPointer, class C *)
-// CXX11-ELIDE-NEXT: 3: [B3.2] (CXXConstructExpr, [B3.5], [B3.6], class C)
-// CXX11-NOELIDE-NEXT: 3: [B3.2] (CXXConstructExpr, [B3.5], class C)
-// CXX11-NEXT: 4: C([B3.3]) (CXXFunctionalCastExpr, ConstructorConversion, class C)
+// CHECK-NEXT: 2: [B3.1] (ImplicitCastExpr, NullToPointer, C *)
+// CXX11-ELIDE-NEXT: 3: [B3.2] (CXXConstructExpr, [B3.5], [B3.6], C)
+// CXX11-NOELIDE-NEXT: 3: [B3.2] (CXXConstructExpr, [B3.5], C)
+// CXX11-NEXT: 4: C([B3.3]) (CXXFunctionalCastExpr, ConstructorConversion, C)
// CXX11-NEXT: 5: [B3.4]
-// CXX11-ELIDE-NEXT: 6: [B3.5] (CXXConstructExpr, [B1.2], [B1.3], class C)
-// CXX11-NOELIDE-NEXT: 6: [B3.5] (CXXConstructExpr, [B1.2], class C)
-// CXX17-NEXT: 3: [B3.2] (CXXConstructExpr, class C)
-// CXX17-NEXT: 4: C([B3.3]) (CXXFunctionalCastExpr, ConstructorConversion, class C)
+// CXX11-ELIDE-NEXT: 6: [B3.5] (CXXConstructExpr, [B1.2], [B1.3], C)
+// CXX11-NOELIDE-NEXT: 6: [B3.5] (CXXConstructExpr, [B1.2], C)
+// CXX17-NEXT: 3: [B3.2] (CXXConstructExpr, C)
+// CXX17-NEXT: 4: C([B3.3]) (CXXFunctionalCastExpr, ConstructorConversion, C)
// CHECK: [B4]
// CHECK-NEXT: 1: coin
// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK: void simpleVariableWithElidableCopy()
// CHECK: 1: 0
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NullToPointer, class C *)
-// CXX11-ELIDE-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.5], [B1.6], class C)
-// CXX11-NOELIDE-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.5], class C)
-// CXX17-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.5], class C)
-// CHECK-NEXT: 4: C([B1.3]) (CXXFunctionalCastExpr, ConstructorConversion, class C)
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NullToPointer, C *)
+// CXX11-ELIDE-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.5], [B1.6], C)
+// CXX11-NOELIDE-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.5], C)
+// CXX17-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.5], C)
+// CHECK-NEXT: 4: C([B1.3]) (CXXFunctionalCastExpr, ConstructorConversion, C)
// CXX11-NEXT: 5: [B1.4]
-// CXX11-NEXT: 6: [B1.5] (CXXConstructExpr, [B1.7], class C)
+// CXX11-NEXT: 6: [B1.5] (CXXConstructExpr, [B1.7], C)
// CXX11-NEXT: 7: C c = C(0);
// CXX17-NEXT: 5: C c = C(0);
void simpleVariableWithElidableCopy() {
// CHECK: void referenceVariableWithConstructor()
// CHECK: 1: 0
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NullToPointer, class C *)
-// CHECK-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.4], const class C)
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NullToPointer, C *)
+// CHECK-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.4], const C)
// CHECK-NEXT: 4: [B1.3]
// CHECK-NEXT: 5: const C &c(0);
void referenceVariableWithConstructor() {
}
// CHECK: void referenceVariableWithInitializer()
-// CHECK: 1: C() (CXXConstructExpr, [B1.3], class C)
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const class C)
+// CHECK: 1: C() (CXXConstructExpr, [B1.3], C)
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const C)
// CHECK-NEXT: 3: [B1.2]
// CHECK-NEXT: 4: const C &c = C();
void referenceVariableWithInitializer() {
// CHECK: [B1]
// CXX11-NEXT: 1: [B4.2] ? [B2.5] : [B3.6]
// CXX17-NEXT: 1: [B4.2] ? [B2.3] : [B3.4]
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const class C)
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const C)
// CHECK-NEXT: 3: [B1.2]
// CHECK-NEXT: 4: const C &c = coin ? C::get() : C(0);
// CHECK: [B2]
// CHECK-NEXT: 1: C::get
-// CHECK-NEXT: 2: [B2.1] (ImplicitCastExpr, FunctionToPointerDecay, class C (*)(void))
+// CHECK-NEXT: 2: [B2.1] (ImplicitCastExpr, FunctionToPointerDecay, C (*)(void))
// CXX11-ELIDE-NEXT: 3: [B2.2]() (CXXRecordTypedCall, [B2.4], [B2.5])
// CXX11-NOELIDE-NEXT: 3: [B2.2]() (CXXRecordTypedCall, [B2.4])
// CXX11-NEXT: 4: [B2.3]
-// CXX11-NEXT: 5: [B2.4] (CXXConstructExpr, [B1.3], class C)
+// CXX11-NEXT: 5: [B2.4] (CXXConstructExpr, [B1.3], C)
// CXX17-NEXT: 3: [B2.2]() (CXXRecordTypedCall, [B1.3])
// CHECK: [B3]
// CHECK-NEXT: 1: 0
-// CHECK-NEXT: 2: [B3.1] (ImplicitCastExpr, NullToPointer, class C *)
-// CXX11-ELIDE-NEXT: 3: [B3.2] (CXXConstructExpr, [B3.5], [B3.6], class C)
-// CXX11-NOELIDE-NEXT: 3: [B3.2] (CXXConstructExpr, [B3.5], class C)
-// CXX11-NEXT: 4: C([B3.3]) (CXXFunctionalCastExpr, ConstructorConversion, class C)
+// CHECK-NEXT: 2: [B3.1] (ImplicitCastExpr, NullToPointer, C *)
+// CXX11-ELIDE-NEXT: 3: [B3.2] (CXXConstructExpr, [B3.5], [B3.6], C)
+// CXX11-NOELIDE-NEXT: 3: [B3.2] (CXXConstructExpr, [B3.5], C)
+// CXX11-NEXT: 4: C([B3.3]) (CXXFunctionalCastExpr, ConstructorConversion, C)
// CXX11-NEXT: 5: [B3.4]
-// CXX11-NEXT: 6: [B3.5] (CXXConstructExpr, [B1.3], class C)
-// CXX17-NEXT: 3: [B3.2] (CXXConstructExpr, [B1.3], class C)
-// CXX17-NEXT: 4: C([B3.3]) (CXXFunctionalCastExpr, ConstructorConversion, class C)
+// CXX11-NEXT: 6: [B3.5] (CXXConstructExpr, [B1.3], C)
+// CXX17-NEXT: 3: [B3.2] (CXXConstructExpr, [B1.3], C)
+// CXX17-NEXT: 4: C([B3.3]) (CXXFunctionalCastExpr, ConstructorConversion, C)
// CHECK: [B4]
// CHECK-NEXT: 1: coin
// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, LValueToRValue, _Bool)
public:
// CHECK: D()
-// CHECK: 1: (CXXConstructExpr, C() (Base initializer), class C)
+// CHECK: 1: (CXXConstructExpr, C() (Base initializer), C)
// CHECK-NEXT: 2: C([B1.1]) (Base initializer)
// CHECK-NEXT: 3: CFGNewAllocator(C *)
-// CHECK-NEXT: 4: (CXXConstructExpr, [B1.5], class C)
+// CHECK-NEXT: 4: (CXXConstructExpr, [B1.5], C)
// CHECK-NEXT: 5: new C([B1.4])
-// CHECK-NEXT: 6: [B1.5] (CXXConstructExpr, c1([B1.5]) (Member initializer), class C)
+// CHECK-NEXT: 6: [B1.5] (CXXConstructExpr, c1([B1.5]) (Member initializer), C)
// CHECK-NEXT: 7: c1([B1.6]) (Member initializer)
D(): C(), c1(new C()) {}
// detected the test would not fail, because FileCheck allows partial matches.
// CHECK: D(double)
// CHECK: 1: C::get
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class C (*)(void))
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, C (*)(void))
// CHECK-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.4])
// CHECK-NEXT: 4: [B1.3]
-// CHECK-NEXT: 5: [B1.4] (CXXConstructExpr, C([B1.4]) (Base initializer), class C)
+// CHECK-NEXT: 5: [B1.4] (CXXConstructExpr, C([B1.4]) (Base initializer), C)
// CHECK-NEXT: 6: C([B1.5]) (Base initializer)
// CHECK-NEXT: 7: CFGNewAllocator(C *)
// CHECK-NEXT: 8: C::get
-// CHECK-NEXT: 9: [B1.8] (ImplicitCastExpr, FunctionToPointerDecay, class C (*)(void))
+// CHECK-NEXT: 9: [B1.8] (ImplicitCastExpr, FunctionToPointerDecay, C (*)(void))
// CXX11-ELIDE-NEXT: 10: [B1.9]() (CXXRecordTypedCall, [B1.11], [B1.12])
// CXX11-NOELIDE-NEXT: 10: [B1.9]() (CXXRecordTypedCall, [B1.11])
// CXX11-NEXT: 11: [B1.10]
-// CXX11-NEXT: 12: [B1.11] (CXXConstructExpr, [B1.13], class C)
+// CXX11-NEXT: 12: [B1.11] (CXXConstructExpr, [B1.13], C)
// CXX11-NEXT: 13: new C([B1.12])
-// CXX11-NEXT: 14: [B1.13] (CXXConstructExpr, c1([B1.13]) (Member initializer), class C)
+// CXX11-NEXT: 14: [B1.13] (CXXConstructExpr, c1([B1.13]) (Member initializer), C)
// CXX11-NEXT: 15: c1([B1.14]) (Member initializer)
// CXX17-NEXT: 10: [B1.9]()
// CXX17-NEXT: 11: new C([B1.10])
-// CXX17-NEXT: 12: [B1.11] (CXXConstructExpr, c1([B1.11]) (Member initializer), class C)
+// CXX17-NEXT: 12: [B1.11] (CXXConstructExpr, c1([B1.11]) (Member initializer), C)
// CXX17-NEXT: 13: c1([B1.12]) (Member initializer)
D(double): C(C::get()), c1(new C(C::get())) {}
};
// FIXME: There should be no temporary destructor in C++17.
// CHECK: F()
// CHECK: 1: E::get
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class ctor_initializers::E (*)(
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, E (*)(
// CXX11-ELIDE-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.4], [B1.6], [B1.7])
// CXX11-NOELIDE-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.4], [B1.6])
// CXX11-NEXT: 4: [B1.3] (BindTemporary)
-// CXX11-NEXT: 5: [B1.4] (ImplicitCastExpr, NoOp, const class ctor_initializers::E)
+// CXX11-NEXT: 5: [B1.4] (ImplicitCastExpr, NoOp, const E)
// CXX11-NEXT: 6: [B1.5]
-// CXX11-NEXT: 7: [B1.6] (CXXConstructExpr, e([B1.6]) (Member initializer), class ctor_initializers
+// CXX11-NEXT: 7: [B1.6] (CXXConstructExpr, e([B1.6]) (Member initializer), E)
// CXX11-NEXT: 8: e([B1.7]) (Member initializer)
-// CXX11-NEXT: 9: ~ctor_initializers::E() (Temporary object destructor)
+// CXX11-NEXT: 9: ~E() (Temporary object destructor)
// CXX17-NEXT: 3: [B1.2]() (CXXRecordTypedCall, e([B1.4]) (Member initializer), [B1.4])
// CXX17-NEXT: 4: [B1.3] (BindTemporary)
// CXX17-NEXT: 5: e([B1.4]) (Member initializer)
-// CXX17-NEXT: 6: ~ctor_initializers::E() (Temporary object destructor)
+// CXX17-NEXT: 6: ~E() (Temporary object destructor)
F(): e(E::get()) {}
};
} // end namespace ctor_initializers
namespace return_stmt_without_dtor {
// CHECK: C returnVariable()
-// CHECK: 1: (CXXConstructExpr, [B1.2], class C)
+// CHECK: 1: (CXXConstructExpr, [B1.2], C)
// CHECK-NEXT: 2: C c;
// CHECK-NEXT: 3: c
-// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, NoOp, class C)
-// CHECK-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.6], class C)
+// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, NoOp, C)
+// CHECK-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.6], C)
// CHECK-NEXT: 6: return [B1.5];
C returnVariable() {
C c;
}
// CHECK: C returnEmptyBraces()
-// CHECK: 1: {} (CXXConstructExpr, [B1.2], class C)
+// CHECK: 1: {} (CXXConstructExpr, [B1.2], C)
// CHECK-NEXT: 2: return [B1.1];
C returnEmptyBraces() {
return {};
// CHECK: C returnBracesWithOperatorNew()
// CHECK: 1: CFGNewAllocator(C *)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B1.3], class C)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B1.3], C)
// CHECK-NEXT: 3: new C([B1.2])
-// CHECK-NEXT: 4: {[B1.3]} (CXXConstructExpr, [B1.5], class C)
+// CHECK-NEXT: 4: {[B1.3]} (CXXConstructExpr, [B1.5], C)
// CHECK-NEXT: 5: return [B1.4];
C returnBracesWithOperatorNew() {
return {new C()};
// CHECK: C returnBracesWithMultipleItems()
// CHECK: 1: 123
// CHECK-NEXT: 2: 456
-// CHECK-NEXT: 3: {[B1.1], [B1.2]} (CXXConstructExpr, [B1.4], class C)
+// CHECK-NEXT: 3: {[B1.1], [B1.2]} (CXXConstructExpr, [B1.4], C)
// CHECK-NEXT: 4: return [B1.3];
C returnBracesWithMultipleItems() {
return {123, 456};
}
// CHECK: C returnTemporary()
-// CXX11-ELIDE: 1: C() (CXXConstructExpr, [B1.2], [B1.3], class C)
-// CXX11-NOELIDE: 1: C() (CXXConstructExpr, [B1.2], class C)
+// CXX11-ELIDE: 1: C() (CXXConstructExpr, [B1.2], [B1.3], C)
+// CXX11-NOELIDE: 1: C() (CXXConstructExpr, [B1.2], C)
// CXX11-NEXT: 2: [B1.1]
-// CXX11-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.4], class C)
+// CXX11-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.4], C)
// CXX11-NEXT: 4: return [B1.3];
-// CXX17: 1: C() (CXXConstructExpr, [B1.2], class C)
+// CXX17: 1: C() (CXXConstructExpr, [B1.2], C)
// CXX17-NEXT: 2: return [B1.1];
C returnTemporary() {
return C();
// CHECK: C returnTemporaryWithArgument()
// CHECK: 1: nullptr
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NullToPointer, class C *)
-// CXX11-ELIDE-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.5], [B1.6], class C)
-// CXX11-NOELIDE-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.5], class C)
-// CXX17-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.5], class C)
-// CHECK-NEXT: 4: C([B1.3]) (CXXFunctionalCastExpr, ConstructorConversion, class C)
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NullToPointer, C *)
+// CXX11-ELIDE-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.5], [B1.6], C)
+// CXX11-NOELIDE-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.5], C)
+// CXX17-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.5], C)
+// CHECK-NEXT: 4: C([B1.3]) (CXXFunctionalCastExpr, ConstructorConversion, C)
// CXX11-NEXT: 5: [B1.4]
-// CXX11-NEXT: 6: [B1.5] (CXXConstructExpr, [B1.7], class C)
+// CXX11-NEXT: 6: [B1.5] (CXXConstructExpr, [B1.7], C)
// CXX11-NEXT: 7: return [B1.6];
// CXX17-NEXT: 5: return [B1.4];
// CHECK: C returnTemporaryConstructedByFunction()
// CHECK: 1: C::get
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class C (*)(void))
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, C (*)(void))
// CXX11-ELIDE-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.4], [B1.5])
// CXX11-NOELIDE-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.4])
// CXX11-NEXT: 4: [B1.3]
-// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.6], class C)
+// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.6], C)
// CXX11-NEXT: 6: return [B1.5];
// CXX17-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.4])
// CXX17-NEXT: 4: return [B1.3];
// CHECK: C returnChainOfCopies()
// CHECK: 1: C::get
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class C (*)(void))
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, C (*)(void))
// CXX11-ELIDE-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.4], [B1.5])
// CXX11-NOELIDE-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.4])
// CXX11-NEXT: 4: [B1.3]
-// CXX11-ELIDE-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.7], [B1.8], class C)
-// CXX11-NOELIDE-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.7], class C)
-// CXX11-NEXT: 6: C([B1.5]) (CXXFunctionalCastExpr, ConstructorConversion, class C)
+// CXX11-ELIDE-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.7], [B1.8], C)
+// CXX11-NOELIDE-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.7], C)
+// CXX11-NEXT: 6: C([B1.5]) (CXXFunctionalCastExpr, ConstructorConversion, C)
// CXX11-NEXT: 7: [B1.6]
-// CXX11-NEXT: 8: [B1.7] (CXXConstructExpr, [B1.9], class C)
+// CXX11-NEXT: 8: [B1.7] (CXXConstructExpr, [B1.9], C)
// CXX11-NEXT: 9: return [B1.8];
// CXX17-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.5])
-// CXX17-NEXT: 4: C([B1.3]) (CXXFunctionalCastExpr, NoOp, class C)
+// CXX17-NEXT: 4: C([B1.3]) (CXXFunctionalCastExpr, NoOp, C)
// CXX17-NEXT: 5: return [B1.4];
C returnChainOfCopies() {
return C(C::get());
~D();
};
-// CHECK: return_stmt_with_dtor::D returnTemporary()
-// CXX11-ELIDE: 1: return_stmt_with_dtor::D() (CXXConstructExpr, [B1.2], [B1.4], [B1.5], class return_stmt_with_dtor::D)
-// CXX11-NOELIDE: 1: return_stmt_with_dtor::D() (CXXConstructExpr, [B1.2], [B1.4], class return_stmt_with_dtor::D)
+// CHECK: D returnTemporary()
+// CXX11-ELIDE: 1: D() (CXXConstructExpr, [B1.2], [B1.4], [B1.5], D)
+// CXX11-NOELIDE: 1: D() (CXXConstructExpr, [B1.2], [B1.4], D)
// CXX11-NEXT: 2: [B1.1] (BindTemporary)
-// CXX11-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const class return_stmt_with_dtor::D)
+// CXX11-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const D)
// CXX11-NEXT: 4: [B1.3]
-// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.7], class return_stmt_with_dtor::D)
-// CXX11-NEXT: 6: ~return_stmt_with_dtor::D() (Temporary object destructor)
+// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.7], D)
+// CXX11-NEXT: 6: ~D() (Temporary object destructor)
// CXX11-NEXT: 7: return [B1.5];
-// CXX17: 1: return_stmt_with_dtor::D() (CXXConstructExpr, [B1.3], [B1.2], class return_stmt_w
+// CXX17: 1: D() (CXXConstructExpr, [B1.3], [B1.2], D)
// CXX17-NEXT: 2: [B1.1] (BindTemporary)
// CXX17-NEXT: 3: return [B1.2];
D returnTemporary() {
// CHECK: void returnByValueIntoVariable()
// CHECK: 1: returnTemporary
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class return_stmt_with_dtor::D (*)(void))
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, D (*)(void))
// CXX11-ELIDE-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.4], [B1.6], [B1.7])
// CXX11-NOELIDE-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.4], [B1.6])
// CXX11-NEXT: 4: [B1.3] (BindTemporary)
-// CXX11-NEXT: 5: [B1.4] (ImplicitCastExpr, NoOp, const class return_stmt_with_dtor::D)
+// CXX11-NEXT: 5: [B1.4] (ImplicitCastExpr, NoOp, const D)
// CXX11-NEXT: 6: [B1.5]
-// CXX11-NEXT: 7: [B1.6] (CXXConstructExpr, [B1.8], class return_stmt_with_dtor::D)
-// CXX11-NEXT: 8: return_stmt_with_dtor::D d = returnTemporary();
-// CXX11-NEXT: 9: ~return_stmt_with_dtor::D() (Temporary object destructor)
-// CXX11-NEXT: 10: [B1.8].~return_stmt_with_dtor::D() (Implicit destructor)
+// CXX11-NEXT: 7: [B1.6] (CXXConstructExpr, [B1.8], D)
+// CXX11-NEXT: 8: D d = returnTemporary();
+// CXX11-NEXT: 9: ~D() (Temporary object destructor)
+// CXX11-NEXT: 10: [B1.8].~D() (Implicit destructor)
// CXX17-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.5], [B1.4])
// CXX17-NEXT: 4: [B1.3] (BindTemporary)
-// CXX17-NEXT: 5: return_stmt_with_dtor::D d = returnTemporary();
+// CXX17-NEXT: 5: D d = returnTemporary();
void returnByValueIntoVariable() {
D d = returnTemporary();
}
// TODO: Should provide construction context for the constructor,
// even if there is no specific trigger statement here.
// CHECK: void simpleTemporary()
-// CHECK: 1: C() (CXXConstructExpr, class C)
+// CHECK: 1: C() (CXXConstructExpr, C)
void simpleTemporary() {
C();
}
// CHECK: void temporaryInCondition()
-// CHECK: 1: C() (CXXConstructExpr, [B2.2], class C)
+// CHECK: 1: C() (CXXConstructExpr, [B2.2], C)
// CHECK-NEXT: 2: [B2.1]
// CHECK-NEXT: 3: [B2.2] (ImplicitCastExpr, NoOp, const class C)
// CHECK-NEXT: 4: [B2.3].operator bool
}
// CHECK: void temporaryInConditionVariable()
-// CXX11-ELIDE: 1: C() (CXXConstructExpr, [B2.2], [B2.3], class C)
-// CXX11-NOELIDE: 1: C() (CXXConstructExpr, [B2.2], class C)
+// CXX11-ELIDE: 1: C() (CXXConstructExpr, [B2.2], [B2.3], C)
+// CXX11-NOELIDE: 1: C() (CXXConstructExpr, [B2.2], C)
// CXX11-NEXT: 2: [B2.1]
-// CXX11-NEXT: 3: [B2.2] (CXXConstructExpr, [B2.4], class C)
+// CXX11-NEXT: 3: [B2.2] (CXXConstructExpr, [B2.4], C)
// CXX11-NEXT: 4: C c = C();
// CXX11-NEXT: 5: c
// CXX11-NEXT: 6: [B2.5] (ImplicitCastExpr, NoOp, const class C)
// CXX11-NEXT: 8: [B2.6]
// CXX11-NEXT: 9: [B2.8] (ImplicitCastExpr, UserDefinedConversion, _Bool)
// CXX11-NEXT: T: if [B2.9]
-// CXX17: 1: C() (CXXConstructExpr, [B2.2], class C)
+// CXX17: 1: C() (CXXConstructExpr, [B2.2], C)
// CXX17-NEXT: 2: C c = C();
// CXX17-NEXT: 3: c
// CXX17-NEXT: 4: [B2.3] (ImplicitCastExpr, NoOp, const class C)
// CHECK: void temporaryInForLoopConditionVariable()
// CHECK: [B2]
-// CXX11-ELIDE-NEXT: 1: C() (CXXConstructExpr, [B2.2], [B2.3], class C)
-// CXX11-NOELIDE-NEXT: 1: C() (CXXConstructExpr, [B2.2], class C)
+// CXX11-ELIDE-NEXT: 1: C() (CXXConstructExpr, [B2.2], [B2.3], C)
+// CXX11-NOELIDE-NEXT: 1: C() (CXXConstructExpr, [B2.2], C)
// CXX11-NEXT: 2: [B2.1]
-// CXX11-NEXT: 3: [B2.2] (CXXConstructExpr, [B2.4], class C)
+// CXX11-NEXT: 3: [B2.2] (CXXConstructExpr, [B2.4], C)
// CXX11-NEXT: 4: C c2 = C();
// CXX11-NEXT: 5: c2
// CXX11-NEXT: 6: [B2.5] (ImplicitCastExpr, NoOp, const class C)
// CXX11-NEXT: 8: [B2.6]
// CXX11-NEXT: 9: [B2.8] (ImplicitCastExpr, UserDefinedConversion, _Bool)
// CXX11-NEXT: T: for (...; [B2.9]; )
-// CXX17-NEXT: 1: C() (CXXConstructExpr, [B2.2], class C)
+// CXX17-NEXT: 1: C() (CXXConstructExpr, [B2.2], C)
// CXX17-NEXT: 2: C c2 = C();
// CXX17-NEXT: 3: c2
// CXX17-NEXT: 4: [B2.3] (ImplicitCastExpr, NoOp, const class C)
// CXX17-NEXT: 7: [B2.6] (ImplicitCastExpr, UserDefinedConversion, _Bool)
// CXX17-NEXT: T: for (...; [B2.7]; )
// CHECK: [B3]
-// CXX11-ELIDE-NEXT: 1: C() (CXXConstructExpr, [B3.2], [B3.3], class C)
-// CXX11-NOELIDE-NEXT: 1: C() (CXXConstructExpr, [B3.2], class C)
+// CXX11-ELIDE-NEXT: 1: C() (CXXConstructExpr, [B3.2], [B3.3], C)
+// CXX11-NOELIDE-NEXT: 1: C() (CXXConstructExpr, [B3.2], C)
// CXX11-NEXT: 2: [B3.1]
-// CXX11-NEXT: 3: [B3.2] (CXXConstructExpr, [B3.4], class C)
+// CXX11-NEXT: 3: [B3.2] (CXXConstructExpr, [B3.4], C)
// CXX11-NEXT: 4: C c1 = C();
-// CXX17-NEXT: 1: C() (CXXConstructExpr, [B3.2], class C)
+// CXX17-NEXT: 1: C() (CXXConstructExpr, [B3.2], C)
// CXX17-NEXT: 2: C c1 = C();
void temporaryInForLoopConditionVariable() {
for (C c1 = C(); C c2 = C(); );
// CHECK: void temporaryInWhileLoopConditionVariable()
-// CXX11-ELIDE: 1: C() (CXXConstructExpr, [B2.2], [B2.3], class C)
-// CXX11-NOELIDE: 1: C() (CXXConstructExpr, [B2.2], class C)
+// CXX11-ELIDE: 1: C() (CXXConstructExpr, [B2.2], [B2.3], C)
+// CXX11-NOELIDE: 1: C() (CXXConstructExpr, [B2.2], C)
// CXX11-NEXT: 2: [B2.1]
-// CXX11-NEXT: 3: [B2.2] (CXXConstructExpr, [B2.4], class C)
+// CXX11-NEXT: 3: [B2.2] (CXXConstructExpr, [B2.4], C)
// CXX11-NEXT: 4: C c = C();
// CXX11-NEXT: 5: c
// CXX11-NEXT: 6: [B2.5] (ImplicitCastExpr, NoOp, const class C)
// CXX11-NEXT: 8: [B2.6]
// CXX11-NEXT: 9: [B2.8] (ImplicitCastExpr, UserDefinedConversion, _Bool)
// CXX11-NEXT: T: while [B2.9]
-// CXX17: 1: C() (CXXConstructExpr, [B2.2], class C)
+// CXX17: 1: C() (CXXConstructExpr, [B2.2], C)
// CXX17-NEXT: 2: C c = C();
// CXX17-NEXT: 3: c
// CXX17-NEXT: 4: [B2.3] (ImplicitCastExpr, NoOp, const class C)
};
// CHECK: void simpleTemporary()
-// CHECK: 1: temporary_object_expr_with_dtors::D() (CXXConstructExpr, [B1.2], class temporary_object_expr_with_dtors::D)
+// CHECK: 1: D() (CXXConstructExpr, [B1.2], D)
// CHECK-NEXT: 2: [B1.1] (BindTemporary)
-// CHECK-NEXT: 3: ~temporary_object_expr_with_dtors::D() (Temporary object destructor)
+// CHECK-NEXT: 3: ~D() (Temporary object destructor)
void simpleTemporary() {
D();
}
// CHECK: void temporaryInCondition()
-// CHECK: 1: temporary_object_expr_with_dtors::D() (CXXConstructExpr, [B2.2], [B2.3], class temporary_object_expr_with_dtors::D)
+// CHECK: 1: D() (CXXConstructExpr, [B2.2], [B2.3], D)
// CHECK-NEXT: 2: [B2.1] (BindTemporary)
// CHECK-NEXT: 3: [B2.2]
// CHECK-NEXT: 4: [B2.3] (ImplicitCastExpr, NoOp, const class temporary_object_expr_with_dtors::D)
// CHECK-NEXT: 5: [B2.4].operator bool
// CHECK-NEXT: 6: [B2.4]
// CHECK-NEXT: 7: [B2.6] (ImplicitCastExpr, UserDefinedConversion, _Bool)
-// CHECK-NEXT: 8: ~temporary_object_expr_with_dtors::D() (Temporary object destructor)
+// CHECK-NEXT: 8: ~D() (Temporary object destructor)
// CHECK-NEXT: T: if [B2.7]
void temporaryInCondition() {
if (D());
// CHECK: void referenceVariableWithConstructor()
// CHECK: 1: 0
-// CHECK-NEXT: 2: [B1.1] (CXXConstructExpr, [B1.4], const class temporary_object_expr_with_dtors::D)
+// CHECK-NEXT: 2: [B1.1] (CXXConstructExpr, [B1.4], const D)
// CHECK-NEXT: 3: [B1.2] (BindTemporary)
// CHECK-NEXT: 4: [B1.3]
-// CHECK-NEXT: 5: const temporary_object_expr_with_dtors::D &d(0);
-// CHECK-NEXT: 6: [B1.5].~temporary_object_expr_with_dtors::D() (Implicit destructor)
+// CHECK-NEXT: 5: const D &d(0);
+// CHECK-NEXT: 6: [B1.5].~D() (Implicit destructor)
void referenceVariableWithConstructor() {
const D &d(0);
}
// CHECK: void referenceVariableWithInitializer()
-// CHECK: 1: temporary_object_expr_with_dtors::D() (CXXConstructExpr, [B1.4], class temporary_object_expr_with_dtors::D)
+// CHECK: 1: D() (CXXConstructExpr, [B1.4], D)
// CHECK-NEXT: 2: [B1.1] (BindTemporary)
-// CHECK-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const class temporary_object_expr_with_dtors::D)
+// CHECK-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const D)
// CHECK-NEXT: 4: [B1.3]
-// CHECK-NEXT: 5: const temporary_object_expr_with_dtors::D &d = temporary_object_expr_with_dtors::D();
-// CHECK-NEXT: 6: [B1.5].~temporary_object_expr_with_dtors::D() (Implicit destructor)
+// CHECK-NEXT: 5: const D &d = D();
+// CHECK-NEXT: 6: [B1.5].~D() (Implicit destructor)
void referenceVariableWithInitializer() {
const D &d = D();
}
// CHECK: void referenceVariableWithTernaryOperator(bool coin)
// CXX11: [B1]
-// CXX11-NEXT: 1: [B4.4].~temporary_object_expr_with_dtors::D() (Implicit destructor)
+// CXX11-NEXT: 1: [B4.4].~D() (Implicit destructor)
// CXX11: [B2]
-// CXX11-NEXT: 1: ~temporary_object_expr_with_dtors::D() (Temporary object destructor)
+// CXX11-NEXT: 1: ~D() (Temporary object destructor)
// CXX11: [B3]
-// CXX11-NEXT: 1: ~temporary_object_expr_with_dtors::D() (Temporary object destructor)
+// CXX11-NEXT: 1: ~D() (Temporary object destructor)
// CXX11: [B4]
// CXX11-NEXT: 1: [B7.2] ? [B5.8] : [B6.8]
-// CXX11-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const class temporary_object_expr_with_dtors::D)
+// CXX11-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const D)
// CXX11-NEXT: 3: [B4.2]
-// CXX11-NEXT: 4: const temporary_object_expr_with_dtors::D &d = coin ? D::get() : temporary_object_expr_with_dtors::D(0);
+// CXX11-NEXT: 4: const D &d = coin ? D::get() : D(0);
// CXX11-NEXT: T: (Temp Dtor) [B6.3]
// CXX11: [B5]
// CXX11-NEXT: 1: D::get
-// CXX11-NEXT: 2: [B5.1] (ImplicitCastExpr, FunctionToPointerDecay, class temporary_object_expr_with_dtors::D (*)(void))
+// CXX11-NEXT: 2: [B5.1] (ImplicitCastExpr, FunctionToPointerDecay, D (*)(void))
// CXX11-ELIDE-NEXT: 3: [B5.2]() (CXXRecordTypedCall, [B5.4], [B5.6], [B5.7])
// CXX11-NOELIDE-NEXT: 3: [B5.2]() (CXXRecordTypedCall, [B5.4], [B5.6])
// CXX11-NEXT: 4: [B5.3] (BindTemporary)
-// CXX11-NEXT: 5: [B5.4] (ImplicitCastExpr, NoOp, const class temporary_object_expr_with_dtors::D)
+// CXX11-NEXT: 5: [B5.4] (ImplicitCastExpr, NoOp, const D)
// CXX11-NEXT: 6: [B5.5]
-// CXX11-NEXT: 7: [B5.6] (CXXConstructExpr, [B4.3], class temporary_object_expr_with_dtors::D)
+// CXX11-NEXT: 7: [B5.6] (CXXConstructExpr, [B4.3], D)
// CXX11-NEXT: 8: [B5.7] (BindTemporary)
// CXX11: [B6]
// CXX11-NEXT: 1: 0
-// CXX11-ELIDE-NEXT: 2: [B6.1] (CXXConstructExpr, [B6.3], [B6.6], [B6.7], class temporary_object_expr_with_dtors::D)
-// CXX11-NOELIDE-NEXT: 2: [B6.1] (CXXConstructExpr, [B6.3], [B6.6], class temporary_object_expr_with_dtors::D)
+// CXX11-ELIDE-NEXT: 2: [B6.1] (CXXConstructExpr, [B6.3], [B6.6], [B6.7], D)
+// CXX11-NOELIDE-NEXT: 2: [B6.1] (CXXConstructExpr, [B6.3], [B6.6], D)
// CXX11-NEXT: 3: [B6.2] (BindTemporary)
-// CXX11-NEXT: 4: temporary_object_expr_with_dtors::D([B6.3]) (CXXFunctionalCastExpr, ConstructorConversion, class temporary_object_expr_with_dtors::D)
-// CXX11-NEXT: 5: [B6.4] (ImplicitCastExpr, NoOp, const class temporary_object_expr_with_dtors::D)
+// CXX11-NEXT: 4: D([B6.3]) (CXXFunctionalCastExpr, ConstructorConversion, D)
+// CXX11-NEXT: 5: [B6.4] (ImplicitCastExpr, NoOp, const D)
// CXX11-NEXT: 6: [B6.5]
-// CXX11-NEXT: 7: [B6.6] (CXXConstructExpr, [B4.3], class temporary_object_expr_with_dtors::D)
+// CXX11-NEXT: 7: [B6.6] (CXXConstructExpr, [B4.3], D)
// CXX11-NEXT: 8: [B6.7] (BindTemporary)
// CXX11: [B7]
// CXX11-NEXT: 1: coin
// CXX11-NEXT: T: [B7.2] ? ... : ...
// CXX17: [B1]
// CXX17-NEXT: 1: [B4.2] ? [B2.4] : [B3.4]
-// CXX17-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const class temporary_object_expr_with_dtors::D)
+// CXX17-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const D)
// CXX17-NEXT: 3: [B1.2]
-// CXX17-NEXT: 4: const temporary_object_expr_with_dtors::D &d = coin ? D::get() : temporary_object_expr_with_dtors::D(0);
-// CXX17-NEXT: 5: [B1.4].~temporary_object_expr_with_dtors::D() (Implicit destructor)
+// CXX17-NEXT: 4: const D &d = coin ? D::get() : D(0);
+// CXX17-NEXT: 5: [B1.4].~D() (Implicit destructor)
// CXX17: [B2]
// CXX17-NEXT: 1: D::get
-// CXX17-NEXT: 2: [B2.1] (ImplicitCastExpr, FunctionToPointerDecay, class temporary_object_expr_with_dtors::D (*)(void))
+// CXX17-NEXT: 2: [B2.1] (ImplicitCastExpr, FunctionToPointerDecay, D (*)(void))
// CXX17-NEXT: 3: [B2.2]() (CXXRecordTypedCall, [B1.3])
// CXX17-NEXT: 4: [B2.3] (BindTemporary)
// CXX17: [B3]
// CXX17-NEXT: 1: 0
-// CXX17-NEXT: 2: [B3.1] (CXXConstructExpr, [B1.3], class temporary_object_expr_with_dtors::D)
+// CXX17-NEXT: 2: [B3.1] (CXXConstructExpr, [B1.3], D)
// CXX17-NEXT: 3: [B3.2] (BindTemporary)
-// CXX17-NEXT: 4: temporary_object_expr_with_dtors::D([B3.3]) (CXXFunctionalCastExpr, ConstructorConversion, class temporary_object_expr_with_dtors::D)
+// CXX17-NEXT: 4: D([B3.3]) (CXXFunctionalCastExpr, ConstructorConversion, D)
// CXX17: [B4]
// CXX17-NEXT: 1: coin
// CXX17-NEXT: 2: [B4.1] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK: void referenceWithFunctionalCast()
// CHECK: 1: 1
-// CHECK-NEXT: 2: [B1.1] (CXXConstructExpr, [B1.5], class temporary_object_expr_with_dtors::D)
+// CHECK-NEXT: 2: [B1.1] (CXXConstructExpr, [B1.5], D)
// CHECK-NEXT: 3: [B1.2] (BindTemporary)
-// CHECK-NEXT: 4: temporary_object_expr_with_dtors::D([B1.3]) (CXXFunctionalCastExpr, ConstructorCon
+// CHECK-NEXT: 4: D([B1.3]) (CXXFunctionalCastExpr, ConstructorCon
// CHECK-NEXT: 5: [B1.4]
-// CHECK-NEXT: 6: temporary_object_expr_with_dtors::D &&d = temporary_object_expr_with_dtors::D(1);
-// CHECK-NEXT: 7: [B1.6].~temporary_object_expr_with_dtors::D() (Implicit destructor)
+// CHECK-NEXT: 6: D &&d = D(1);
+// CHECK-NEXT: 7: [B1.6].~D() (Implicit destructor)
void referenceWithFunctionalCast() {
D &&d = D(1);
}
// Test the condition constructor, we don't care about branch constructors here.
// CHECK: void constructorInTernaryCondition()
// CXX11: 1: 1
-// CXX11-NEXT: 2: [B7.1] (CXXConstructExpr, [B7.3], [B7.5], class temporary_object_expr_with_dtors::D)
+// CXX11-NEXT: 2: [B7.1] (CXXConstructExpr, [B7.3], [B7.5], D)
// CXX11-NEXT: 3: [B7.2] (BindTemporary)
-// CXX11-NEXT: 4: temporary_object_expr_with_dtors::D([B7.3]) (CXXFunctionalCastExpr, ConstructorConversion, class temporary_object_expr_with_dtors::D)
+// CXX11-NEXT: 4: D([B7.3]) (CXXFunctionalCastExpr, ConstructorConversion, D)
// CXX11-NEXT: 5: [B7.4]
// CXX11-NEXT: 6: [B7.5] (ImplicitCastExpr, NoOp, const class temporary_object_expr_with_dtors::D)
// CXX11-NEXT: 7: [B7.6].operator bool
// CXX11-NEXT: 9: [B7.8] (ImplicitCastExpr, UserDefinedConversion, _Bool)
// CXX11-NEXT: T: [B7.9] ? ... : ...
// CXX17: 1: 1
-// CXX17-NEXT: 2: [B4.1] (CXXConstructExpr, [B4.3], [B4.5], class temporary_object_expr_with_dtors::D)
+// CXX17-NEXT: 2: [B4.1] (CXXConstructExpr, [B4.3], [B4.5], D)
// CXX17-NEXT: 3: [B4.2] (BindTemporary)
-// CXX17-NEXT: 4: temporary_object_expr_with_dtors::D([B4.3]) (CXXFunctionalCastExpr, ConstructorConversion, class temporary_object_expr_with_dtors::D)
+// CXX17-NEXT: 4: D([B4.3]) (CXXFunctionalCastExpr, ConstructorConversion, D)
// CXX17-NEXT: 5: [B4.4]
// CXX17-NEXT: 6: [B4.5] (ImplicitCastExpr, NoOp, const class temporary_object_expr_with_dtors::D)
// CXX17-NEXT: 7: [B4.6].operator bool
};
// CHECK: void implicitConstructionConversionFromTemporary()
-// CHECK: 1: implicit_constructor_conversion::A() (CXXConstructExpr, [B1.3], class implicit_constructor_conversion::A)
-// CXX11-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const class implicit_constructor_conversion::A)
+// CHECK: 1: A() (CXXConstructExpr, [B1.3], A)
+// CXX11-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const A)
// CXX11-NEXT: 3: [B1.2]
-// CXX11-ELIDE-NEXT: 4: [B1.3] (CXXConstructExpr, [B1.6], [B1.8], [B1.9], class implicit_constructor_conversion::B)
-// CXX11-NOELIDE-NEXT: 4: [B1.3] (CXXConstructExpr, [B1.6], [B1.8], class implicit_constructor_conversion::B)
-// CXX11-NEXT: 5: [B1.4] (ImplicitCastExpr, ConstructorConversion, class implicit_constructor_conversion::B)
+// CXX11-ELIDE-NEXT: 4: [B1.3] (CXXConstructExpr, [B1.6], [B1.8], [B1.9], B)
+// CXX11-NOELIDE-NEXT: 4: [B1.3] (CXXConstructExpr, [B1.6], [B1.8], B)
+// CXX11-NEXT: 5: [B1.4] (ImplicitCastExpr, ConstructorConversion, B)
// CXX11-NEXT: 6: [B1.5] (BindTemporary)
-// CXX11-NEXT: 7: [B1.6] (ImplicitCastExpr, NoOp, const class implicit_constructor_conversion::B)
+// CXX11-NEXT: 7: [B1.6] (ImplicitCastExpr, NoOp, const B)
// CXX11-NEXT: 8: [B1.7]
-// CXX11-NEXT: 9: [B1.8] (CXXConstructExpr, [B1.10], class implicit_constructor_conversion::B)
-// CXX11-NEXT: 10: implicit_constructor_conversion::B b = implicit_constructor_conversion::A();
-// CXX11-NEXT: 11: ~implicit_constructor_conversion::B() (Temporary object destructor)
-// CXX11-NEXT: 12: [B1.10].~implicit_constructor_conversion::B() (Implicit destructor)
-// CXX17-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const class implicit_constructor_conversion::A)
+// CXX11-NEXT: 9: [B1.8] (CXXConstructExpr, [B1.10], B)
+// CXX11-NEXT: 10: B b = A();
+// CXX11-NEXT: 11: ~B() (Temporary object destructor)
+// CXX11-NEXT: 12: [B1.10].~B() (Implicit destructor)
+// CXX17-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const A)
// CXX17-NEXT: 3: [B1.2]
-// CXX17-NEXT: 4: [B1.3] (CXXConstructExpr, [B1.6], class implicit_constructor_conversion::B)
-// CXX17-NEXT: 5: [B1.4] (ImplicitCastExpr, ConstructorConversion, class implicit_constructor_conversion::B)
-// CXX17-NEXT: 6: implicit_constructor_conversion::B b = implicit_constructor_conversion::A();
-// CXX17-NEXT: 7: [B1.6].~implicit_constructor_conversion::B() (Implicit destructor)
+// CXX17-NEXT: 4: [B1.3] (CXXConstructExpr, [B1.6], B)
+// CXX17-NEXT: 5: [B1.4] (ImplicitCastExpr, ConstructorConversion, B)
+// CXX17-NEXT: 6: B b = A();
+// CXX17-NEXT: 7: [B1.6].~B() (Implicit destructor)
void implicitConstructionConversionFromTemporary() {
B b = A();
}
// CHECK: void implicitConstructionConversionFromFunctionValue()
// CHECK: 1: get
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class implicit_constructor_conversion::A (*)(void))
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, A (*)(void))
// CHECK-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.5])
-// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, NoOp, const class implicit_constructor_conversion::A)
+// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 5: [B1.4]
-// CXX11-ELIDE-NEXT: 6: [B1.5] (CXXConstructExpr, [B1.8], [B1.10], [B1.11], class implicit_constructor_conversion::B)
-// CXX11-NOELIDE-NEXT: 6: [B1.5] (CXXConstructExpr, [B1.8], [B1.10], class implicit_constructor_conversion::B)
-// CXX11-NEXT: 7: [B1.6] (ImplicitCastExpr, ConstructorConversion, class implicit_constructor_conversion::B)
+// CXX11-ELIDE-NEXT: 6: [B1.5] (CXXConstructExpr, [B1.8], [B1.10], [B1.11], B)
+// CXX11-NOELIDE-NEXT: 6: [B1.5] (CXXConstructExpr, [B1.8], [B1.10], B)
+// CXX11-NEXT: 7: [B1.6] (ImplicitCastExpr, ConstructorConversion, B)
// CXX11-NEXT: 8: [B1.7] (BindTemporary)
-// CXX11-NEXT: 9: [B1.8] (ImplicitCastExpr, NoOp, const class implicit_constructor_conversion::B)
+// CXX11-NEXT: 9: [B1.8] (ImplicitCastExpr, NoOp, const B)
// CXX11-NEXT: 10: [B1.9]
-// CXX11-NEXT: 11: [B1.10] (CXXConstructExpr, [B1.12], class implicit_constructor_conversion::B)
-// CXX11-NEXT: 12: implicit_constructor_conversion::B b = get();
-// CXX11-NEXT: 13: ~implicit_constructor_conversion::B() (Temporary object destructor)
-// CXX11-NEXT: 14: [B1.12].~implicit_constructor_conversion::B() (Implicit destructor)
-// CXX17-NEXT: 6: [B1.5] (CXXConstructExpr, [B1.8], class implicit_constructor_conversion::B)
-// CXX17-NEXT: 7: [B1.6] (ImplicitCastExpr, ConstructorConversion, class implicit_constructor_conversion::B)
-// CXX17-NEXT: 8: implicit_constructor_conversion::B b = get();
-// CXX17-NEXT: 9: [B1.8].~implicit_constructor_conversion::B() (Implicit destructor)
+// CXX11-NEXT: 11: [B1.10] (CXXConstructExpr, [B1.12], B)
+// CXX11-NEXT: 12: B b = get();
+// CXX11-NEXT: 13: ~B() (Temporary object destructor)
+// CXX11-NEXT: 14: [B1.12].~B() (Implicit destructor)
+// CXX17-NEXT: 6: [B1.5] (CXXConstructExpr, [B1.8], B)
+// CXX17-NEXT: 7: [B1.6] (ImplicitCastExpr, ConstructorConversion, B)
+// CXX17-NEXT: 8: B b = get();
+// CXX17-NEXT: 9: [B1.8].~B() (Implicit destructor)
void implicitConstructionConversionFromFunctionValue() {
B b = get();
}
// CHECK: void implicitConstructionConversionFromTemporaryWithLifetimeExtension()
-// CHECK: 1: implicit_constructor_conversion::A() (CXXConstructExpr, [B1.3], class implicit_constructor_conversion::A)
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const class implicit_constructor_conversion::A)
+// CHECK: 1: A() (CXXConstructExpr, [B1.3], A)
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 3: [B1.2]
-// CHECK-NEXT: 4: [B1.3] (CXXConstructExpr, [B1.7], class implicit_constructor_conversion::B)
-// CHECK-NEXT: 5: [B1.4] (ImplicitCastExpr, ConstructorConversion, class implicit_constructor_conversion::B)
-// CHECK-NEXT: 6: [B1.5] (ImplicitCastExpr, NoOp, const class implicit_constructor_conversion::B)
+// CHECK-NEXT: 4: [B1.3] (CXXConstructExpr, [B1.7], B)
+// CHECK-NEXT: 5: [B1.4] (ImplicitCastExpr, ConstructorConversion, B)
+// CHECK-NEXT: 6: [B1.5] (ImplicitCastExpr, NoOp, const B)
// CHECK-NEXT: 7: [B1.6]
-// CHECK-NEXT: 8: const implicit_constructor_conversion::B &b = implicit_constructor_conversion::A();
-// CHECK-NEXT: 9: [B1.8].~implicit_constructor_conversion::B() (Implicit destructor)
+// CHECK-NEXT: 8: const B &b = A();
+// CHECK-NEXT: 9: [B1.8].~B() (Implicit destructor)
void implicitConstructionConversionFromTemporaryWithLifetimeExtension() {
const B &b = A();
}
// CHECK: void implicitConstructionConversionFromFunctionValueWithLifetimeExtension()
// CHECK: 1: get
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class implicit_constructor_conver
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, A (*)(void))
// CHECK-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.5])
-// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, NoOp, const class implicit_constructor_conversion::A)
+// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 5: [B1.4]
-// CHECK-NEXT: 6: [B1.5] (CXXConstructExpr, [B1.9], class implicit_constructor_conversion::B)
-// CHECK-NEXT: 7: [B1.6] (ImplicitCastExpr, ConstructorConversion, class implicit_constructor_convers
-// CHECK-NEXT: 8: [B1.7] (ImplicitCastExpr, NoOp, const class implicit_constructor_conversion::B)
+// CHECK-NEXT: 6: [B1.5] (CXXConstructExpr, [B1.9], B)
+// CHECK-NEXT: 7: [B1.6] (ImplicitCastExpr, ConstructorConversion, B)
+// CHECK-NEXT: 8: [B1.7] (ImplicitCastExpr, NoOp, const B)
// CHECK-NEXT: 9: [B1.8]
-// CHECK-NEXT: 10: const implicit_constructor_conversion::B &b = get();
-// CHECK-NEXT: 11: [B1.10].~implicit_constructor_conversion::B() (Implicit destructor)
+// CHECK-NEXT: 10: const B &b = get();
+// CHECK-NEXT: 11: [B1.10].~B() (Implicit destructor)
void implicitConstructionConversionFromFunctionValueWithLifetimeExtension() {
const B &b = get(); // no-crash
}
// CHECK: void passArgument()
// CHECK: 1: useC
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(class C))
-// CXX11-ELIDE-NEXT: 3: C() (CXXConstructExpr, [B1.4], [B1.5], class C)
-// CXX11-NOELIDE-NEXT: 3: C() (CXXConstructExpr, [B1.4], class C)
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(C))
+// CXX11-ELIDE-NEXT: 3: C() (CXXConstructExpr, [B1.4], [B1.5], C)
+// CXX11-NOELIDE-NEXT: 3: C() (CXXConstructExpr, [B1.4], C)
// CXX11-NEXT: 4: [B1.3]
-// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.6]+0, class C)
+// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.6]+0, C)
// CXX11-NEXT: 6: [B1.2]([B1.5])
-// CXX17-NEXT: 3: C() (CXXConstructExpr, [B1.4]+0, class C)
+// CXX17-NEXT: 3: C() (CXXConstructExpr, [B1.4]+0, C)
// CXX17-NEXT: 4: [B1.2]([B1.3])
void passArgument() {
useC(C());
// CHECK: void passTwoArguments()
// CHECK: [B1]
// CHECK-NEXT: 1: useCAndD
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(class C, class argument_constructors::D))
-// CXX11-ELIDE-NEXT: 3: C() (CXXConstructExpr, [B1.4], [B1.5], class C)
-// CXX11-NOELIDE-NEXT: 3: C() (CXXConstructExpr, [B1.4], class C)
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(C, D))
+// CXX11-ELIDE-NEXT: 3: C() (CXXConstructExpr, [B1.4], [B1.5], C)
+// CXX11-NOELIDE-NEXT: 3: C() (CXXConstructExpr, [B1.4], C)
// CXX11-NEXT: 4: [B1.3]
-// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.12]+0, class C)
-// CXX11-ELIDE-NEXT: 6: argument_constructors::D() (CXXConstructExpr, [B1.7], [B1.9], [B1.10], class argument_constructors::D)
-// CXX11-NOELIDE-NEXT: 6: argument_constructors::D() (CXXConstructExpr, [B1.7], [B1.9], class argument_constructors::D)
+// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.12]+0, C)
+// CXX11-ELIDE-NEXT: 6: D() (CXXConstructExpr, [B1.7], [B1.9], [B1.10], D)
+// CXX11-NOELIDE-NEXT: 6: D() (CXXConstructExpr, [B1.7], [B1.9], D)
// CXX11-NEXT: 7: [B1.6] (BindTemporary)
-// CXX11-NEXT: 8: [B1.7] (ImplicitCastExpr, NoOp, const class argument_constructors::D)
+// CXX11-NEXT: 8: [B1.7] (ImplicitCastExpr, NoOp, const D)
// CXX11-NEXT: 9: [B1.8]
-// CXX11-NEXT: 10: [B1.9] (CXXConstructExpr, [B1.11], [B1.12]+1, class argument_constructors::D)
+// CXX11-NEXT: 10: [B1.9] (CXXConstructExpr, [B1.11], [B1.12]+1, D)
// CXX11-NEXT: 11: [B1.10] (BindTemporary)
// CXX11-NEXT: 12: [B1.2]([B1.5], [B1.11])
-// CXX11-NEXT: 13: ~argument_constructors::D() (Temporary object destructor)
-// CXX11-NEXT: 14: ~argument_constructors::D() (Temporary object destructor)
-// CXX17-NEXT: 3: C() (CXXConstructExpr, [B1.6]+0, class C)
-// CXX17-NEXT: 4: argument_constructors::D() (CXXConstructExpr, [B1.5], [B1.6]+1, class argument_co
+// CXX11-NEXT: 13: ~D() (Temporary object destructor)
+// CXX11-NEXT: 14: ~D() (Temporary object destructor)
+// CXX17-NEXT: 3: C() (CXXConstructExpr, [B1.6]+0, C)
+// CXX17-NEXT: 4: D() (CXXConstructExpr, [B1.5], [B1.6]+1, D)
// CXX17-NEXT: 5: [B1.4] (BindTemporary)
// CXX17-NEXT: 6: [B1.2]([B1.3], [B1.5])
-// CXX17-NEXT: 7: ~argument_constructors::D() (Temporary object destructor)
+// CXX17-NEXT: 7: ~D() (Temporary object destructor)
void passTwoArguments() {
useCAndD(C(), D());
}
// CHECK: void passArgumentByReference()
// CHECK: 1: useCByReference
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const class C &))
-// CHECK-NEXT: 3: C() (CXXConstructExpr, [B1.5], class C)
-// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, NoOp, const class C)
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const C &))
+// CHECK-NEXT: 3: C() (CXXConstructExpr, [B1.5], C)
+// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, NoOp, const C)
// CHECK-NEXT: 5: [B1.4]
// CHECK-NEXT: 6: [B1.2]([B1.5])
void passArgumentByReference() {
// CHECK: void passArgumentWithDestructor()
// CHECK: 1: useD
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(class argument_constructors::D))
-// CXX11-ELIDE-NEXT: 3: argument_constructors::D() (CXXConstructExpr, [B1.4], [B1.6], [B1.7], class argument_constructors::D)
-// CXX11-NOELIDE-NEXT: 3: argument_constructors::D() (CXXConstructExpr, [B1.4], [B1.6], class argument_constructors::D)
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(D))
+// CXX11-ELIDE-NEXT: 3: D() (CXXConstructExpr, [B1.4], [B1.6], [B1.7], D)
+// CXX11-NOELIDE-NEXT: 3: D() (CXXConstructExpr, [B1.4], [B1.6], D)
// CXX11-NEXT: 4: [B1.3] (BindTemporary)
-// CXX11-NEXT: 5: [B1.4] (ImplicitCastExpr, NoOp, const class argument_constructors::D)
+// CXX11-NEXT: 5: [B1.4] (ImplicitCastExpr, NoOp, const D)
// CXX11-NEXT: 6: [B1.5]
-// CXX11-NEXT: 7: [B1.6] (CXXConstructExpr, [B1.8], [B1.9]+0, class argument_constructors::D)
+// CXX11-NEXT: 7: [B1.6] (CXXConstructExpr, [B1.8], [B1.9]+0, D)
// CXX11-NEXT: 8: [B1.7] (BindTemporary)
// CXX11-NEXT: 9: [B1.2]([B1.8])
-// CXX11-NEXT: 10: ~argument_constructors::D() (Temporary object destructor)
-// CXX11-NEXT: 11: ~argument_constructors::D() (Temporary object destructor)
-// CXX17-NEXT: 3: argument_constructors::D() (CXXConstructExpr, [B1.4], [B1.5]+0, class argument_constructors::D)
+// CXX11-NEXT: 10: ~D() (Temporary object destructor)
+// CXX11-NEXT: 11: ~D() (Temporary object destructor)
+// CXX17-NEXT: 3: D() (CXXConstructExpr, [B1.4], [B1.5]+0, D)
// CXX17-NEXT: 4: [B1.3] (BindTemporary)
// CXX17-NEXT: 5: [B1.2]([B1.4])
-// CXX17-NEXT: 6: ~argument_constructors::D() (Temporary object destructor)
+// CXX17-NEXT: 6: ~D() (Temporary object destructor)
void passArgumentWithDestructor() {
useD(D());
}
// CHECK: void passArgumentWithDestructorByReference()
// CHECK: 1: useDByReference
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const class argumen
-// CHECK-NEXT: 3: argument_constructors::D() (CXXConstructExpr, [B1.4], [B1.6], class argument_c
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const D &))
+// CHECK-NEXT: 3: D() (CXXConstructExpr, [B1.4], [B1.6], D)
// CHECK-NEXT: 4: [B1.3] (BindTemporary)
-// CHECK-NEXT: 5: [B1.4] (ImplicitCastExpr, NoOp, const class argument_constructors::D)
+// CHECK-NEXT: 5: [B1.4] (ImplicitCastExpr, NoOp, const D)
// CHECK-NEXT: 6: [B1.5]
// CHECK-NEXT: 7: [B1.2]([B1.6])
-// CHECK-NEXT: 8: ~argument_constructors::D() (Temporary object destructor)
+// CHECK-NEXT: 8: ~D() (Temporary object destructor)
void passArgumentWithDestructorByReference() {
useDByReference(D());
}
// CHECK: void passArgumentIntoAnotherConstructor()
-// CXX11-ELIDE: 1: argument_constructors::D() (CXXConstructExpr, [B1.2], [B1.4], [B1.5], class argument_constructors::D)
-// CXX11-NOELIDE: 1: argument_constructors::D() (CXXConstructExpr, [B1.2], [B1.4], class argument_constructors::D)
+// CXX11-ELIDE: 1: D() (CXXConstructExpr, [B1.2], [B1.4], [B1.5], D)
+// CXX11-NOELIDE: 1: D() (CXXConstructExpr, [B1.2], [B1.4], D)
// CXX11-NEXT: 2: [B1.1] (BindTemporary)
-// CXX11-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const class argument_constructors::D)
+// CXX11-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const D)
// CXX11-NEXT: 4: [B1.3]
-// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.6], [B1.7]+0, class argument_constructors::D)
+// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.6], [B1.7]+0, D)
// CXX11-NEXT: 6: [B1.5] (BindTemporary)
-// CXX11-ELIDE-NEXT: 7: [B1.6] (CXXConstructExpr, [B1.9], [B1.10], class argument_constructors::E)
-// CXX11-NOELIDE-NEXT: 7: [B1.6] (CXXConstructExpr, [B1.9], class argument_constructors::E)
-// CXX11-NEXT: 8: argument_constructors::E([B1.7]) (CXXFunctionalCastExpr, ConstructorConversion, class argument_constructors::E)
+// CXX11-ELIDE-NEXT: 7: [B1.6] (CXXConstructExpr, [B1.9], [B1.10], E)
+// CXX11-NOELIDE-NEXT: 7: [B1.6] (CXXConstructExpr, [B1.9], E)
+// CXX11-NEXT: 8: E([B1.7]) (CXXFunctionalCastExpr, ConstructorConversion, E)
// CXX11-NEXT: 9: [B1.8]
-// CXX11-NEXT: 10: [B1.9] (CXXConstructExpr, [B1.11], class argument_constructors::E)
-// CXX11-NEXT: 11: argument_constructors::E e = argument_constructors::E(argument_constructors::D());
-// CXX11-NEXT: 12: ~argument_constructors::D() (Temporary object destructor)
-// CXX11-NEXT: 13: ~argument_constructors::D() (Temporary object destructor)
-// CXX17: 1: argument_constructors::D() (CXXConstructExpr, [B1.2], [B1.3]+0, class argument_constructors::D)
+// CXX11-NEXT: 10: [B1.9] (CXXConstructExpr, [B1.11], E)
+// CXX11-NEXT: 11: E e = E(D());
+// CXX11-NEXT: 12: ~D() (Temporary object destructor)
+// CXX11-NEXT: 13: ~D() (Temporary object destructor)
+// CXX17: 1: D() (CXXConstructExpr, [B1.2], [B1.3]+0, D)
// CXX17-NEXT: 2: [B1.1] (BindTemporary)
-// CXX17-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.5], class argument_constructors::E)
-// CXX17-NEXT: 4: argument_constructors::E([B1.3]) (CXXFunctionalCastExpr, ConstructorConversion, class argument_constructors::E)
-// CXX17-NEXT: 5: argument_constructors::E e = argument_constructors::E(argument_constructors::D());
-// CXX17-NEXT: 6: ~argument_constructors::D() (Temporary object destructor)
+// CXX17-NEXT: 3: [B1.2] (CXXConstructExpr, [B1.5], E)
+// CXX17-NEXT: 4: E([B1.3]) (CXXFunctionalCastExpr, ConstructorConversion, E)
+// CXX17-NEXT: 5: E e = E(D());
+// CXX17-NEXT: 6: ~D() (Temporary object destructor)
void passArgumentIntoAnotherConstructor() {
E e = E(D());
}
// CHECK: void passTwoArgumentsIntoAnotherConstructor()
-// CXX11-ELIDE: 1: argument_constructors::D() (CXXConstructExpr, [B1.2], [B1.4], [B1.5], class argument_constructors::D)
-// CXX11-NOELIDE: 1: argument_constructors::D() (CXXConstructExpr, [B1.2], [B1.4], class argument_constructors::D)
+// CXX11-ELIDE: 1: D() (CXXConstructExpr, [B1.2], [B1.4], [B1.5], D)
+// CXX11-NOELIDE: 1: D() (CXXConstructExpr, [B1.2], [B1.4], D)
// CXX11-NEXT: 2: [B1.1] (BindTemporary)
-// CXX11-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const class argument_constructors::D)
+// CXX11-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const D)
// CXX11-NEXT: 4: [B1.3]
-// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.6], [B1.13]+0, class argument_constructors::D)
+// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.6], [B1.13]+0, D)
// CXX11-NEXT: 6: [B1.5] (BindTemporary)
-// CXX11-ELIDE-NEXT: 7: argument_constructors::D() (CXXConstructExpr, [B1.8], [B1.10], [B1.11], class argument_constructors::D)
-// CXX11-NOELIDE-NEXT: 7: argument_constructors::D() (CXXConstructExpr, [B1.8], [B1.10], class argument_constructors::D)
+// CXX11-ELIDE-NEXT: 7: D() (CXXConstructExpr, [B1.8], [B1.10], [B1.11], D)
+// CXX11-NOELIDE-NEXT: 7: D() (CXXConstructExpr, [B1.8], [B1.10], D)
// CXX11-NEXT: 8: [B1.7] (BindTemporary)
-// CXX11-NEXT: 9: [B1.8] (ImplicitCastExpr, NoOp, const class argument_constructors::D)
+// CXX11-NEXT: 9: [B1.8] (ImplicitCastExpr, NoOp, const D)
// CXX11-NEXT: 10: [B1.9]
-// CXX11-NEXT: 11: [B1.10] (CXXConstructExpr, [B1.12], [B1.13]+1, class argument_constructors::D)
+// CXX11-NEXT: 11: [B1.10] (CXXConstructExpr, [B1.12], [B1.13]+1, D)
// CXX11-NEXT: 12: [B1.11] (BindTemporary)
-// CXX11-NEXT: 13: argument_constructors::E([B1.6], [B1.12]) (CXXConstructExpr, class argument_constructors::E)
-// CXX11-NEXT: 14: ~argument_constructors::D() (Temporary object destructor)
-// CXX11-NEXT: 15: ~argument_constructors::D() (Temporary object destructor)
-// CXX11-NEXT: 16: ~argument_constructors::D() (Temporary object destructor)
-// CXX11-NEXT: 17: ~argument_constructors::D() (Temporary object destructor)
-// CXX17: 1: argument_constructors::D() (CXXConstructExpr, [B1.2], [B1.5]+0, class argument_constructors::D)
+// CXX11-NEXT: 13: E([B1.6], [B1.12]) (CXXConstructExpr, E)
+// CXX11-NEXT: 14: ~D() (Temporary object destructor)
+// CXX11-NEXT: 15: ~D() (Temporary object destructor)
+// CXX11-NEXT: 16: ~D() (Temporary object destructor)
+// CXX11-NEXT: 17: ~D() (Temporary object destructor)
+// CXX17: 1: D() (CXXConstructExpr, [B1.2], [B1.5]+0, D)
// CXX17-NEXT: 2: [B1.1] (BindTemporary)
-// CXX17-NEXT: 3: argument_constructors::D() (CXXConstructExpr, [B1.4], [B1.5]+1, class argument_constructors::D)
+// CXX17-NEXT: 3: D() (CXXConstructExpr, [B1.4], [B1.5]+1, D)
// CXX17-NEXT: 4: [B1.3] (BindTemporary)
-// CXX17-NEXT: 5: argument_constructors::E([B1.2], [B1.4]) (CXXConstructExpr, class argument_constructors::E)
-// CXX17-NEXT: 6: ~argument_constructors::D() (Temporary object destructor)
-// CXX17-NEXT: 7: ~argument_constructors::D() (Temporary object destructor)
+// CXX17-NEXT: 5: E([B1.2], [B1.4]) (CXXConstructExpr, E)
+// CXX17-NEXT: 6: ~D() (Temporary object destructor)
+// CXX17-NEXT: 7: ~D() (Temporary object destructor)
void passTwoArgumentsIntoAnotherConstructor() {
E(D(), D());
}
// CHECK: void testCopyElisionWhenCopyConstructorHasExtraArguments()
// CHECK: [B1]
-// CXX11-ELIDE-NEXT: 1: copy_elision_with_extra_arguments::C() (CXXConstructExpr, [B1.3], [B1.5], class copy_elision_with_extra_arguments::C)
-// CXX11-NOELIDE-NEXT: 1: copy_elision_with_extra_arguments::C() (CXXConstructExpr, [B1.3], class copy_elision_with_extra_arguments::C)
-// CXX11-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const class copy_elision_with_extra_arguments::C)
+// CXX11-ELIDE-NEXT: 1: C() (CXXConstructExpr, [B1.3], [B1.5], C)
+// CXX11-NOELIDE-NEXT: 1: C() (CXXConstructExpr, [B1.3], C)
+// CXX11-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const C)
// CXX11-NEXT: 3: [B1.2]
// CXX11-NEXT: 4:
-// CXX11-NEXT: 5: [B1.3] (CXXConstructExpr, [B1.6], class copy_elision_with_extra_arguments::C)
-// CXX11-NEXT: 6: copy_elision_with_extra_arguments::C c = copy_elision_with_extra_arguments::C();
-// CXX17-NEXT: 1: copy_elision_with_extra_arguments::C() (CXXConstructExpr, [B1.2], class copy_elision_with_extra_arguments::C)
-// CXX17-NEXT: 2: copy_elision_with_extra_arguments::C c = copy_elision_with_extra_arguments::C();
+// CXX11-NEXT: 5: [B1.3] (CXXConstructExpr, [B1.6], C)
+// CXX11-NEXT: 6: C c = C();
+// CXX17-NEXT: 1: C() (CXXConstructExpr, [B1.2], C)
+// CXX17-NEXT: 2: C c = C();
void testCopyElisionWhenCopyConstructorHasExtraArguments() {
C c = C();
}
// CHECK: void testOperators()
// CHECK: [B1]
// CHECK-NEXT: 1: operator+
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class operators::C &(*)(class o
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, C &(*)(C))
// CHECK-NEXT: 3: 1
-// CHECK-NEXT: 4: [B1.3] (CXXConstructExpr, [B1.6], class operators::C)
-// CHECK-NEXT: 5: operators::C([B1.4]) (CXXFunctionalCastExpr, ConstructorConversion, class operato
+// CHECK-NEXT: 4: [B1.3] (CXXConstructExpr, [B1.6], C)
+// CHECK-NEXT: 5: C([B1.4]) (CXXFunctionalCastExpr, ConstructorConversion, C)
// CHECK-NEXT: 6: [B1.5]
// CHECK-NEXT: 7: 2
-// CXX11-ELIDE-NEXT: 8: [B1.7] (CXXConstructExpr, [B1.10], [B1.11], class operators::C)
-// CXX11-NOELIDE-NEXT: 8: [B1.7] (CXXConstructExpr, [B1.10], class operators::C)
-// CXX11-NEXT: 9: operators::C([B1.8]) (CXXFunctionalCastExpr, ConstructorConversion, class operato
+// CXX11-ELIDE-NEXT: 8: [B1.7] (CXXConstructExpr, [B1.10], [B1.11], C)
+// CXX11-NOELIDE-NEXT: 8: [B1.7] (CXXConstructExpr, [B1.10], C)
+// CXX11-NEXT: 9: C([B1.8]) (CXXFunctionalCastExpr, ConstructorConversion, C)
// CXX11-NEXT: 10: [B1.9]
-// CXX11-NEXT: 11: [B1.10] (CXXConstructExpr, [B1.12]+1, class operators::C)
+// CXX11-NEXT: 11: [B1.10] (CXXConstructExpr, [B1.12]+1, C)
// CXX11-NEXT: 12: [B1.6] + [B1.11] (OperatorCall)
-// CXX17-NEXT: 8: [B1.7] (CXXConstructExpr, [B1.10]+1, class operators::C)
-// CXX17-NEXT: 9: operators::C([B1.8]) (CXXFunctionalCastExpr, ConstructorConversion, class operato
+// CXX17-NEXT: 8: [B1.7] (CXXConstructExpr, [B1.10]+1, C)
+// CXX17-NEXT: 9: C([B1.8]) (CXXFunctionalCastExpr, ConstructorConversion, C)
// CXX17-NEXT: 10: [B1.6] + [B1.9] (OperatorCall)
void testOperators() {
C(1) + C(2);
// CHECK: void testTransparentInitListExprs()
// CHECK: [B1]
// CHECK-NEXT: 1: getC
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class transparent_init_list_exprs::C (*)(void))
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, C (*)(void))
// CXX11-ELIDE-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.4], [B1.5])
// CXX11-NOELIDE-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.4])
// CXX11-NEXT: 4: [B1.3]
-// CXX11-NEXT: 5: {[B1.4]} (CXXConstructExpr, [B1.6], class transparent_init_list_exprs::C)
-// CXX11-NEXT: 6: transparent_init_list_exprs::C c{getC()};
+// CXX11-NEXT: 5: {[B1.4]} (CXXConstructExpr, [B1.6], C)
+// CXX11-NEXT: 6: C c{getC()};
// CXX17-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.5])
// CXX17-NEXT: 4: {[B1.3]}
-// CXX17-NEXT: 5: transparent_init_list_exprs::C c{getC()};
+// CXX17-NEXT: 5: C c{getC()};
namespace transparent_init_list_exprs {
class C {};
C getC();
// CHECK: void passArgumentIntoMessage(E *e)
// CHECK: 1: e
// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, LValueToRValue, E *)
-// CXX11-ELIDE-NEXT: 3: D() (CXXConstructExpr, [B1.4], [B1.6], [B1.7], class D)
-// CXX11-NOELIDE-NEXT: 3: D() (CXXConstructExpr, [B1.4], [B1.6], class D)
+// CXX11-ELIDE-NEXT: 3: D() (CXXConstructExpr, [B1.4], [B1.6], [B1.7], D)
+// CXX11-NOELIDE-NEXT: 3: D() (CXXConstructExpr, [B1.4], [B1.6], D)
// CXX11-NEXT: 4: [B1.3] (BindTemporary)
-// CXX11-NEXT: 5: [B1.4] (ImplicitCastExpr, NoOp, const class D)
+// CXX11-NEXT: 5: [B1.4] (ImplicitCastExpr, NoOp, const D)
// CXX11-NEXT: 6: [B1.5]
-// CXX11-NEXT: 7: [B1.6] (CXXConstructExpr, [B1.8], [B1.9]+0, class D)
+// CXX11-NEXT: 7: [B1.6] (CXXConstructExpr, [B1.8], [B1.9]+0, D)
// CXX11-NEXT: 8: [B1.7] (BindTemporary)
// Double brackets trigger FileCheck variables, escape.
// CXX11-NEXT: 9: {{\[}}[B1.2] foo:[B1.8]]
// CXX11-NEXT: 10: ~D() (Temporary object destructor)
// CXX11-NEXT: 11: ~D() (Temporary object destructor)
-// CXX17-NEXT: 3: D() (CXXConstructExpr, [B1.4], [B1.5]+0, class D)
+// CXX17-NEXT: 3: D() (CXXConstructExpr, [B1.4], [B1.5]+0, D)
// CXX17-NEXT: 4: [B1.3] (BindTemporary)
// Double brackets trigger FileCheck variables, escape.
// CXX17-NEXT: 5: {{\[}}[B1.2] foo:[B1.4]]
// CXX11-ELIDE-NEXT: 3: {{\[}}[B1.2] bar] (CXXRecordTypedCall, [B1.4], [B1.6], [B1.7])
// CXX11-NOELIDE-NEXT: 3: {{\[}}[B1.2] bar] (CXXRecordTypedCall, [B1.4], [B1.6])
// CXX11-NEXT: 4: [B1.3] (BindTemporary)
-// CXX11-NEXT: 5: [B1.4] (ImplicitCastExpr, NoOp, const class D)
+// CXX11-NEXT: 5: [B1.4] (ImplicitCastExpr, NoOp, const D)
// CXX11-NEXT: 6: [B1.5]
-// CXX11-NEXT: 7: [B1.6] (CXXConstructExpr, [B1.8], class D)
+// CXX11-NEXT: 7: [B1.6] (CXXConstructExpr, [B1.8], D)
// CXX11-NEXT: 8: D d = [e bar];
// CXX11-NEXT: 9: ~D() (Temporary object destructor)
// CXX11-NEXT: 10: [B1.8].~D() (Implicit destructor)
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
// CHECK-NEXT: 1: e
-// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, LValueToRValue, enum EmptyE)
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, LValueToRValue, EmptyE)
// CHECK-NEXT: 3: [B1.2] (ImplicitCastExpr, IntegralCast, int)
// CHECK-NEXT: T: switch [B1.3]
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
// CHECK-NEXT: 1: CFGNewAllocator(A *)
-// WARNINGS-NEXT: 2: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 2: (CXXConstructExpr, [B1.3], class A)
+// WARNINGS-NEXT: 2: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 2: (CXXConstructExpr, [B1.3], A)
// CHECK-NEXT: 3: new A([B1.2])
// CHECK-NEXT: 4: A *a = new A();
// CHECK-NEXT: 5: a
-// CHECK-NEXT: 6: [B1.5] (ImplicitCastExpr, LValueToRValue, class A *)
+// CHECK-NEXT: 6: [B1.5] (ImplicitCastExpr, LValueToRValue, A *)
// CHECK-NEXT: 7: [B1.6]->~A() (Implicit destructor)
// CHECK-NEXT: 8: delete [B1.6]
// CHECK-NEXT: Preds (1): B2
// CHECK: [B1]
// CHECK-NEXT: 1: 5
// CHECK-NEXT: 2: CFGNewAllocator(A *)
-// WARNINGS-NEXT: 3: (CXXConstructExpr, class A[5])
-// ANALYZER-NEXT: 3: (CXXConstructExpr, [B1.4], class A[5])
+// WARNINGS-NEXT: 3: (CXXConstructExpr, A[5])
+// ANALYZER-NEXT: 3: (CXXConstructExpr, [B1.4], A[5])
// CHECK-NEXT: 4: new A {{\[\[}}B1.1]]
// CHECK-NEXT: 5: A *a = new A [5];
// CHECK-NEXT: 6: a
-// CHECK-NEXT: 7: [B1.6] (ImplicitCastExpr, LValueToRValue, class A *)
+// CHECK-NEXT: 7: [B1.6] (ImplicitCastExpr, LValueToRValue, A *)
// CHECK-NEXT: 8: [B1.7]->~A() (Implicit destructor)
// CHECK-NEXT: 9: delete [] [B1.7]
// CHECK-NEXT: Preds (1): B2
// CHECK-LABEL: int test1(int *x)
// CHECK: 1: 1
// CHECK-NEXT: 2: return
-// CHECK-NEXT: ~NoReturnSingleSuccessor::B() (Implicit destructor)
+// CHECK-NEXT: ~B() (Implicit destructor)
// CHECK-NEXT: Preds (1)
// CHECK-NEXT: Succs (1): B0
int test1(int *x) {
// CHECK-NEXT: 3: [B1.2] (ImplicitCastExpr, ArrayToPointerDecay, int *)
// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, BitCast, void *)
// CHECK-NEXT: 5: CFGNewAllocator(MyClass *)
-// WARNINGS-NEXT: 6: (CXXConstructExpr, class MyClass)
-// ANALYZER-NEXT: 6: (CXXConstructExpr, [B1.7], class MyClass)
+// WARNINGS-NEXT: 6: (CXXConstructExpr, MyClass)
+// ANALYZER-NEXT: 6: (CXXConstructExpr, [B1.7], MyClass)
// CHECK-NEXT: 7: new ([B1.4]) MyClass([B1.6])
// CHECK-NEXT: 8: MyClass *obj = new (buffer) MyClass();
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, BitCast, void *)
// CHECK-NEXT: 5: 5
// CHECK-NEXT: 6: CFGNewAllocator(MyClass *)
-// WARNINGS-NEXT: 7: (CXXConstructExpr, class MyClass[5])
-// ANALYZER-NEXT: 7: (CXXConstructExpr, [B1.8], class MyClass[5])
+// WARNINGS-NEXT: 7: (CXXConstructExpr, MyClass[5])
+// ANALYZER-NEXT: 7: (CXXConstructExpr, [B1.8], MyClass[5])
// CHECK-NEXT: 8: new ([B1.4]) MyClass {{\[\[}}B1.5]]
// CHECK-NEXT: 9: MyClass *obj = new (buffer) MyClass [5];
// CHECK-NEXT: Preds (1): B2
// CHECK: [B2 (ENTRY)]
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, struct pr37688_deleted_union_destructor::A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B1.2], struct pr37688_deleted_union_destructor::A)
-// CHECK-NEXT: 2: pr37688_deleted_union_destructor::A a;
-// CHECK-NEXT: 3: [B1.2].~pr37688_deleted_union_destructor::A() (Implicit destructor)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B1.2], A)
+// CHECK-NEXT: 2: A a;
+// CHECK-NEXT: 3: [B1.2].~A() (Implicit destructor)
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: Succs (1): B0
// CHECK: [B0 (EXIT)]
// CHECK-LABEL: void CommaTemp::f()
// CHECK: [B1]
-// CHECK-NEXT: 1: CommaTemp::A() (CXXConstructExpr,
+// CHECK-NEXT: 1: A() (CXXConstructExpr,
// CHECK-NEXT: 2: [B1.1] (BindTemporary)
-// CHECK-NEXT: 3: CommaTemp::B() (CXXConstructExpr,
+// CHECK-NEXT: 3: B() (CXXConstructExpr,
// CHECK-NEXT: 4: [B1.3] (BindTemporary)
// CHECK-NEXT: 5: ... , [B1.4]
-// CHECK-NEXT: 6: ~CommaTemp::B() (Temporary object destructor)
-// CHECK-NEXT: 7: ~CommaTemp::A() (Temporary object destructor)
+// CHECK-NEXT: 6: ~B() (Temporary object destructor)
+// CHECK-NEXT: 7: ~A() (Temporary object destructor)
namespace CommaTemp {
struct A { ~A(); };
struct B { ~B(); };
// CHECK-NEXT: Preds (2): B3 B4
// CHECK-NEXT: Succs (1): B1
// CHECK: [B3]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, struct ClassWithDtor)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], struct ClassWithDtor)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, ClassWithDtor)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, [B3.2], ClassWithDtor)
// CHECK-NEXT: 2: thread_local ClassWithDtor a;
// CHECK-NEXT: Preds (1): B4
// CHECK-NEXT: Succs (1): B2
ClassWithoutDestructor make1(AddressVector<ClassWithoutDestructor> &v) {
return ClassWithoutDestructor(v);
// no-elide-warning@-1 {{Address of stack memory associated with temporary \
-object of type 'address_vector_tests::ClassWithoutDestructor' is still \
+object of type 'ClassWithoutDestructor' is still \
referred to by the stack variable 'v' upon returning to the caller}}
}
ClassWithoutDestructor make2(AddressVector<ClassWithoutDestructor> &v) {
return make1(v);
// no-elide-warning@-1 {{Address of stack memory associated with temporary \
-object of type 'address_vector_tests::ClassWithoutDestructor' is still \
+object of type 'ClassWithoutDestructor' is still \
referred to by the stack variable 'v' upon returning to the caller}}
}
ClassWithoutDestructor make3(AddressVector<ClassWithoutDestructor> &v) {
return make2(v);
// no-elide-warning@-1 {{Address of stack memory associated with temporary \
-object of type 'address_vector_tests::ClassWithoutDestructor' is still \
+object of type 'ClassWithoutDestructor' is still \
referred to by the stack variable 'v' upon returning to the caller}}
}
TestCtorInitializer(AddressVector<ClassWithDestructor> &v)
: c(ClassWithDestructor(v)) {}
// no-elide-warning@-1 {{Address of stack memory associated with temporary \
-object of type 'address_vector_tests::ClassWithDestructor' is still referred \
+object of type 'ClassWithDestructor' is still referred \
to by the stack variable 'v' upon returning to the caller}}
};
ClassWithDestructor make1(AddressVector<ClassWithDestructor> &v) {
return ClassWithDestructor(v);
// no-elide-warning@-1 {{Address of stack memory associated with temporary \
-object of type 'address_vector_tests::ClassWithDestructor' is still referred \
+object of type 'ClassWithDestructor' is still referred \
to by the stack variable 'v' upon returning to the caller}}
}
ClassWithDestructor make2(AddressVector<ClassWithDestructor> &v) {
return make1(v);
// no-elide-warning@-1 {{Address of stack memory associated with temporary \
-object of type 'address_vector_tests::ClassWithDestructor' is still referred \
+object of type 'ClassWithDestructor' is still referred \
to by the stack variable 'v' upon returning to the caller}}
}
ClassWithDestructor make3(AddressVector<ClassWithDestructor> &v) {
return make2(v);
// no-elide-warning@-1 {{Address of stack memory associated with temporary \
-object of type 'address_vector_tests::ClassWithDestructor' is still referred \
+object of type 'ClassWithDestructor' is still referred \
to by the stack variable 'v' upon returning to the caller}}
}
Foo make1(Foo **r) {
return Foo(r);
// no-elide-warning@-1 {{Address of stack memory associated with temporary \
-object of type 'address_vector_tests::Foo' is still referred to by the stack \
+object of type 'Foo' is still referred to by the stack \
variable 'z' upon returning to the caller}}
}
struct DynTBase1 {};
struct DynTDerived1 : DynTBase1 {
- int y; // expected-note{{uninitialized field 'static_cast<struct DynTDerived1 *>(this->bptr)->y'}}
+ int y; // expected-note{{uninitialized field 'static_cast<DynTDerived1 *>(this->bptr)->y'}}
};
struct DynamicTypeTest1 {
};
struct DynTBase2 {
- int x; // expected-note{{uninitialized field 'static_cast<struct DynTDerived2 *>(this->bptr)->DynTBase2::x'}}
+ int x; // expected-note{{uninitialized field 'static_cast<DynTDerived2 *>(this->bptr)->DynTBase2::x'}}
};
struct DynTDerived2 : DynTBase2 {
- int y; // expected-note{{uninitialized field 'static_cast<struct DynTDerived2 *>(this->bptr)->y'}}
+ int y; // expected-note{{uninitialized field 'static_cast<DynTDerived2 *>(this->bptr)->y'}}
};
struct DynamicTypeTest2 {
// CHECK: \"cluster\": \"t\", \"pointer\": \"{{0x[0-9a-f]+}}\", \"items\": [\l \{ \"kind\": \"Default\", \"offset\": 0, \"value\": \"conj_$2\{int, LC5, no stmt, #1\}\"
-// CHECK: \"dynamic_types\": [\l \{ \"region\": \"HeapSymRegion\{conj_$1\{struct S *, LC1, S{{[0-9]+}}, #1\}\}\", \"dyn_type\": \"struct S\", \"sub_classable\": false \}\l
+// CHECK: \"dynamic_types\": [\l \{ \"region\": \"HeapSymRegion\{conj_$1\{S *, LC1, S{{[0-9]+}}, #1\}\}\", \"dyn_type\": \"S\", \"sub_classable\": false \}\l
void test() {
// CHECK: Dynamic Types:
// CHECK-SAME: <tr><td align="left"><table border="0"><tr>
- // CHECK-SAME: <td align="left">HeapSymRegion\{conj_$1\{struct S *, LC1,
+ // CHECK-SAME: <td align="left">HeapSymRegion\{conj_$1\{S *, LC1,
// CHECK-SAME: S{{[0-9]*}}, #1\}\}</td>
- // CHECK-SAME: <td align="left">struct S</td>
+ // CHECK-SAME: <td align="left">S</td>
// CHECK-SAME: </tr></table></td></tr>
new S;
}
// CHECK: [B3 (ENTRY)]
// CHECK-NEXT: Succs (1): B2
// CHECK: [B1]
- // WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
- // ANALYZER-NEXT: 1: (CXXConstructExpr, A() (Base initializer), class A)
+ // WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+ // ANALYZER-NEXT: 1: (CXXConstructExpr, A() (Base initializer), A)
// CHECK-NEXT: 2: A([B1.1]) (Base initializer)
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: Succs (1): B0
// CHECK: [B1]
// CHECK-NEXT: 1: i
// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, LValueToRValue, int)
- // WARNINGS-NEXT: 3: [B1.2] (CXXConstructExpr, class A)
- // ANALYZER-NEXT: 3: [B1.2] (CXXConstructExpr, A([B1.2]) (Base initializer), class A)
+ // WARNINGS-NEXT: 3: [B1.2] (CXXConstructExpr, A)
+ // ANALYZER-NEXT: 3: [B1.2] (CXXConstructExpr, A([B1.2]) (Base initializer), A)
// CHECK-NEXT: 4: A([B1.3]) (Base initializer)
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: Succs (1): B0
// CHECK: [B3 (ENTRY)]
// CHECK-NEXT: Succs (1): B2
// CHECK: [B1]
- // WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
- // ANALYZER-NEXT: 1: (CXXConstructExpr, A() (Base initializer), class A)
+ // WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+ // ANALYZER-NEXT: 1: (CXXConstructExpr, A() (Base initializer), A)
// CHECK-NEXT: 2: A([B1.1]) (Base initializer)
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: Succs (1): B0
// CHECK: [B1]
// CHECK-NEXT: 1: i
// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, LValueToRValue, int)
- // WARNINGS-NEXT: 3: [B1.2] (CXXConstructExpr, class A)
- // ANALYZER-NEXT: 3: [B1.2] (CXXConstructExpr, A([B1.2]) (Base initializer), class A)
+ // WARNINGS-NEXT: 3: [B1.2] (CXXConstructExpr, A)
+ // ANALYZER-NEXT: 3: [B1.2] (CXXConstructExpr, A([B1.2]) (Base initializer), A)
// CHECK-NEXT: 4: A([B1.3]) (Base initializer)
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: Succs (1): B0
// CHECK: [B4 (ENTRY)]
// CHECK-NEXT: Succs (1): B3
// CHECK: [B1]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class C)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, C() (Base initializer), class C)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, C)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, C() (Base initializer), C)
// CHECK-NEXT: 2: C([B1.1]) (Base initializer)
-// WARNINGS-NEXT: 3: (CXXConstructExpr, class B)
-// ANALYZER-NEXT: 3: (CXXConstructExpr, B() (Base initializer), class B)
+// WARNINGS-NEXT: 3: (CXXConstructExpr, B)
+// ANALYZER-NEXT: 3: (CXXConstructExpr, B() (Base initializer), B)
// CHECK-NEXT: 4: B([B1.3]) (Base initializer)
-// WARNINGS-NEXT: 5: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 5: (CXXConstructExpr, A() (Base initializer), class A)
+// WARNINGS-NEXT: 5: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 5: (CXXConstructExpr, A() (Base initializer), A)
// CHECK-NEXT: 6: A([B1.5]) (Base initializer)
// CHECK-NEXT: 7: i(/*implicit*/(int)0) (Member initializer)
// CHECK-NEXT: 8: this
// CHECK-NEXT: 9: [B1.8]->i
// CHECK-NEXT: 10: r([B1.9]) (Member initializer)
-// WARNINGS-NEXT: 11: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 11: (CXXConstructExpr, [B1.12], class A)
+// WARNINGS-NEXT: 11: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 11: (CXXConstructExpr, [B1.12], A)
// CHECK-NEXT: 12: A a;
// CHECK-NEXT: Preds (2): B2 B3
// CHECK-NEXT: Succs (1): B0
// CHECK: [B2]
-// WARNINGS-NEXT: 1: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 1: (CXXConstructExpr, A() (Base initializer), class A)
+// WARNINGS-NEXT: 1: (CXXConstructExpr, A)
+// ANALYZER-NEXT: 1: (CXXConstructExpr, A() (Base initializer), A)
// CHECK-NEXT: 2: A([B2.1]) (Base initializer)
// CHECK-NEXT: Preds (1): B3
// CHECK-NEXT: Succs (1): B1
// CHECK-NEXT: Succs (1): B9
// CHECK: [B1]
// CHECK-NEXT: 1: [B4.2] ? [B2.1] : [B3.1]
-// WARNINGS-NEXT: 2: [B1.1] (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 2: [B1.1] (CXXConstructExpr, a([B1.1]) (Member initializer), class A)
+// WARNINGS-NEXT: 2: [B1.1] (CXXConstructExpr, A)
+// ANALYZER-NEXT: 2: [B1.1] (CXXConstructExpr, a([B1.1]) (Member initializer), A)
// CHECK-NEXT: 3: a([B1.2]) (Member initializer)
// CHECK-NEXT: Preds (2): B2 B3
// CHECK-NEXT: Succs (1): B0
// CHECK-NEXT: Succs (2): B2 B3
// CHECK: [B5]
// CHECK-NEXT: 1: [B8.2] ? [B6.1] : [B7.1]
-// WARNINGS-NEXT: 2: [B5.1] (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 2: [B5.1] (CXXConstructExpr, A([B5.1]) (Base initializer), class A)
+// WARNINGS-NEXT: 2: [B5.1] (CXXConstructExpr, A)
+// ANALYZER-NEXT: 2: [B5.1] (CXXConstructExpr, A([B5.1]) (Base initializer), A)
// CHECK-NEXT: 3: A([B5.2]) (Base initializer)
// CHECK-NEXT: Preds (2): B6 B7
// CHECK-NEXT: Succs (1): B4
<key>type</key><string>Dereference of null pointer</string>
<key>check_name</key><string>core.NullDereference</string>
<!-- This hash is experimental and going to change! -->
- <key>issue_hash_content_of_line_in_context</key><string>675157873c1414a885eb1f429b26f389</string>
+ <key>issue_hash_content_of_line_in_context</key><string>9261b182b35fa6b6f1d0c750c41f4933</string>
<key>issue_hash_function_offset</key><string>1</string>
<key>location</key>
<dict>
<key>type</key><string>Dereference of null pointer</string>
<key>check_name</key><string>core.NullDereference</string>
<!-- This hash is experimental and going to change! -->
- <key>issue_hash_content_of_line_in_context</key><string>aff5e83726a1ce1144580e4c80bde47c</string>
+ <key>issue_hash_content_of_line_in_context</key><string>a073d3adfe741b2e3d871c7442446e3b</string>
<key>issue_hash_function_offset</key><string>1</string>
<key>location</key>
<dict>
<key>type</key><string>Dereference of null pointer</string>
<key>check_name</key><string>core.NullDereference</string>
<!-- This hash is experimental and going to change! -->
- <key>issue_hash_content_of_line_in_context</key><string>9484c73e190dfe4b8c6c5bdfad9700c1</string>
+ <key>issue_hash_content_of_line_in_context</key><string>37a2ac98868b90fdc54ac673daab004f</string>
<key>issue_context_kind</key><string>C++ method</string>
<key>issue_context</key><string>operator=</string>
<key>issue_hash_function_offset</key><string>1</string>
<key>type</key><string>Dereference of null pointer</string>
<key>check_name</key><string>core.NullDereference</string>
<!-- This hash is experimental and going to change! -->
- <key>issue_hash_content_of_line_in_context</key><string>a0f0ac76cf282b61236bfac7eb2eca62</string>
+ <key>issue_hash_content_of_line_in_context</key><string>350efb59f475dca2427e8ac4c72f33f1</string>
<key>issue_context_kind</key><string>C++ method</string>
<key>issue_context</key><string>operator=</string>
<key>issue_hash_function_offset</key><string>1</string>
<key>type</key><string>Dereference of null pointer</string>
<key>check_name</key><string>core.NullDereference</string>
<!-- This hash is experimental and going to change! -->
- <key>issue_hash_content_of_line_in_context</key><string>749bda64658e48896477213e90176f5e</string>
+ <key>issue_hash_content_of_line_in_context</key><string>59af00b5ddf4849d000d583bb5722c8a</string>
<key>issue_context_kind</key><string>function</string>
<key>issue_context</key><string>test</string>
<key>issue_hash_function_offset</key><string>2</string>
<key>type</key><string>Called C++ object pointer is null</string>
<key>check_name</key><string>core.CallAndMessage</string>
<!-- This hash is experimental and going to change! -->
- <key>issue_hash_content_of_line_in_context</key><string>8b577b362ffa5a7290d00d03635c1fca</string>
+ <key>issue_hash_content_of_line_in_context</key><string>f5a1486363a2814a8268d71daf54a2f8</string>
<key>issue_context_kind</key><string>function</string>
<key>issue_context</key><string>testDeclRefExprToReferenceInGetDerefExpr</string>
<key>issue_hash_function_offset</key><string>8</string>
// CHECK: Succs (1): B1
// CHECK: [B1]
// CHECK: 1: x
-// CHECK: 2: [B1.1] (ImplicitCastExpr, NoOp, const struct X)
-// CHECK: 3: [B1.2] (CXXConstructExpr[B1.4]+0, struct X)
+// CHECK: 2: [B1.1] (ImplicitCastExpr, NoOp, const X)
+// CHECK: 3: [B1.2] (CXXConstructExpr[B1.4]+0, X)
// CHECK: 4: [x] {
// CHECK: }
// CHECK: 5: (void)[B1.4] (CStyleCastExpr, ToVoid, void)
// CHECK: [B2 (ENTRY)]
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: a
-// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 5: const A &b = a;
-// CHECK-NEXT: 6: A() (CXXConstructExpr, class A)
+// CHECK-NEXT: 6: A() (CXXConstructExpr, A)
// CHECK-NEXT: 7: [B1.6] (BindTemporary)
-// CHECK-NEXT: 8: [B1.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 8: [B1.7] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 9: [B1.8]
// CHECK-NEXT: 10: const A &c = A();
// CHECK-NEXT: 11: [B1.10] (Lifetime ends)
// CHECK: [B2 (ENTRY)]
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A[2])
+// CHECK-NEXT: 1: (CXXConstructExpr, A[2])
// CHECK-NEXT: 2: A a[2];
-// CHECK-NEXT: 3: (CXXConstructExpr, class A[0])
+// CHECK-NEXT: 3: (CXXConstructExpr, A[0])
// CHECK-NEXT: 4: A b[0];
// lifetime of a ends when its destructors are run
// CHECK-NEXT: 5: [B1.2] (Lifetime ends)
// CHECK: [B2 (ENTRY)]
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A a;
-// CHECK-NEXT: 3: (CXXConstructExpr, class A)
+// CHECK-NEXT: 3: (CXXConstructExpr, A)
// CHECK-NEXT: 4: A c;
-// CHECK-NEXT: 5: (CXXConstructExpr, class A)
+// CHECK-NEXT: 5: (CXXConstructExpr, A)
// CHECK-NEXT: 6: A d;
// CHECK-NEXT: 7: [B1.6] (Lifetime ends)
// CHECK-NEXT: 8: [B1.4] (Lifetime ends)
-// CHECK-NEXT: 9: (CXXConstructExpr, class A)
+// CHECK-NEXT: 9: (CXXConstructExpr, A)
// CHECK-NEXT: 10: A b;
// CHECK-NEXT: 11: [B1.10] (Lifetime ends)
// CHECK-NEXT: 12: [B1.2] (Lifetime ends)
// CHECK: [B4 (ENTRY)]
// CHECK-NEXT: Succs (1): B3
// CHECK: [B1]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B1.2] (Lifetime ends)
// CHECK-NEXT: 4: [B3.4] (Lifetime ends)
// CHECK-NEXT: Preds (1): B3
// CHECK-NEXT: Succs (1): B0
// CHECK: [B3]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A a;
-// CHECK-NEXT: 3: (CXXConstructExpr, class A)
+// CHECK-NEXT: 3: (CXXConstructExpr, A)
// CHECK-NEXT: 4: A b;
// CHECK-NEXT: 5: UV
// CHECK-NEXT: 6: [B3.5] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: Preds (2): B2 B3
// CHECK-NEXT: Succs (1): B0
// CHECK: [B2]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B2.2] (Lifetime ends)
// CHECK-NEXT: Preds (1): B4
// CHECK-NEXT: Succs (1): B1
// CHECK: [B3]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B3.2] (Lifetime ends)
// CHECK-NEXT: Preds (1): B4
// CHECK-NEXT: Succs (1): B1
// CHECK: [B4]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: a
// CHECK-NEXT: 4: [B4.3] (ImplicitCastExpr, NoOp, const class A)
-// CHECK-NEXT: 5: [B4.4] (CXXConstructExpr, class A)
+// CHECK-NEXT: 5: [B4.4] (CXXConstructExpr, A)
// CHECK-NEXT: 6: A b = a;
// CHECK-NEXT: 7: b
// CHECK-NEXT: 8: [B4.7] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Succs (1): B8
// CHECK: [B1]
// CHECK-NEXT: 1: [B8.6] (Lifetime ends)
-// CHECK-NEXT: 2: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, A)
// CHECK-NEXT: 3: A e;
// CHECK-NEXT: 4: [B1.3] (Lifetime ends)
// CHECK-NEXT: 5: [B8.2] (Lifetime ends)
// CHECK-NEXT: Preds (2): B2 B5
// CHECK-NEXT: Succs (1): B0
// CHECK: [B2]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A d;
// CHECK-NEXT: 3: [B2.2] (Lifetime ends)
// CHECK-NEXT: 4: [B4.2] (Lifetime ends)
// CHECK-NEXT: Preds (1): B4
// CHECK-NEXT: Succs (1): B0
// CHECK: [B4]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: UV
// CHECK-NEXT: 4: [B4.3] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: Preds (1): B8
// CHECK-NEXT: Succs (2): B3 B2
// CHECK: [B5]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A d;
// CHECK-NEXT: 3: [B5.2] (Lifetime ends)
// CHECK-NEXT: 4: [B7.2] (Lifetime ends)
// CHECK-NEXT: Preds (1): B7
// CHECK-NEXT: Succs (1): B0
// CHECK: [B7]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: UV
// CHECK-NEXT: 4: [B7.3] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: Preds (1): B8
// CHECK-NEXT: Succs (2): B6 B5
// CHECK: [B8]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: a
// CHECK-NEXT: 4: [B8.3] (ImplicitCastExpr, NoOp, const class A)
-// CHECK-NEXT: 5: [B8.4] (CXXConstructExpr, class A)
+// CHECK-NEXT: 5: [B8.4] (CXXConstructExpr, A)
// CHECK-NEXT: 6: A b = a;
// CHECK-NEXT: 7: b
// CHECK-NEXT: 8: [B8.7] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Preds (1): B3
// CHECK-NEXT: Succs (1): B4
// CHECK: [B3]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B3.2] (Lifetime ends)
// CHECK-NEXT: 4: [B4.4] (Lifetime ends)
// CHECK: [B4]
// CHECK-NEXT: 1: a
// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
-// CHECK-NEXT: 3: [B4.2] (CXXConstructExpr, class A)
+// CHECK-NEXT: 3: [B4.2] (CXXConstructExpr, A)
// CHECK-NEXT: 4: A b = a;
// CHECK-NEXT: 5: b
// CHECK-NEXT: 6: [B4.5] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Preds (2): B2 B5
// CHECK-NEXT: Succs (2): B3 B1
// CHECK: [B5]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: Preds (1): B6
// CHECK-NEXT: Succs (1): B4
// CHECK-NEXT: Succs (1): B11
// CHECK: [B1]
// CHECK-NEXT: 1: [B10.4] (Lifetime ends)
-// CHECK-NEXT: 2: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, A)
// CHECK-NEXT: 3: A e;
// CHECK-NEXT: 4: [B1.3] (Lifetime ends)
// CHECK-NEXT: 5: [B11.2] (Lifetime ends)
// CHECK-NEXT: Preds (2): B3 B6
// CHECK-NEXT: Succs (1): B10
// CHECK: [B3]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A d;
// CHECK-NEXT: 3: [B3.2] (Lifetime ends)
// CHECK-NEXT: 4: [B9.2] (Lifetime ends)
// CHECK-NEXT: Preds (1): B9
// CHECK-NEXT: Succs (1): B1
// CHECK: [B9]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: UV
// CHECK-NEXT: 4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK: [B10]
// CHECK-NEXT: 1: a
// CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const class A)
-// CHECK-NEXT: 3: [B10.2] (CXXConstructExpr, class A)
+// CHECK-NEXT: 3: [B10.2] (CXXConstructExpr, A)
// CHECK-NEXT: 4: A b = a;
// CHECK-NEXT: 5: b
// CHECK-NEXT: 6: [B10.5] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Preds (2): B2 B11
// CHECK-NEXT: Succs (2): B9 B1
// CHECK: [B11]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: Preds (1): B12
// CHECK-NEXT: Succs (1): B10
// CHECK: [B12 (ENTRY)]
// CHECK-NEXT: Succs (1): B11
// CHECK: [B1]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A d;
// CHECK-NEXT: 3: [B1.2] (Lifetime ends)
// CHECK-NEXT: 4: [B11.2] (Lifetime ends)
// CHECK-NEXT: Preds (2): B3 B6
// CHECK-NEXT: Succs (2): B10 B1
// CHECK: [B3]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B3.2] (Lifetime ends)
// CHECK-NEXT: 4: [B9.2] (Lifetime ends)
// CHECK-NEXT: Preds (1): B9
// CHECK-NEXT: Succs (1): B1
// CHECK: [B9]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A b;
// CHECK-NEXT: 3: UV
// CHECK-NEXT: 4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: Succs (1): B9
// CHECK: [B11]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: Preds (1): B12
// CHECK-NEXT: Succs (1): B9
// CHECK-NEXT: Preds (1): B3
// CHECK-NEXT: Succs (1): B4
// CHECK: [B3]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B3.2] (Lifetime ends)
// CHECK-NEXT: 4: [B4.4] (Lifetime ends)
// CHECK: [B4]
// CHECK-NEXT: 1: a
// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
-// CHECK-NEXT: 3: [B4.2] (CXXConstructExpr, class A)
+// CHECK-NEXT: 3: [B4.2] (CXXConstructExpr, A)
// CHECK-NEXT: 4: A b = a;
// CHECK-NEXT: 5: b
// CHECK-NEXT: 6: [B4.5] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Preds (2): B2 B5
// CHECK-NEXT: Succs (2): B3 B1
// CHECK: [B5]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: Preds (1): B6
// CHECK-NEXT: Succs (1): B4
// CHECK: [B1]
// CHECK-NEXT: 1: [B10.4] (Lifetime ends)
// CHECK-NEXT: 2: [B11.4] (Lifetime ends)
-// CHECK-NEXT: 3: (CXXConstructExpr, class A)
+// CHECK-NEXT: 3: (CXXConstructExpr, A)
// CHECK-NEXT: 4: A f;
// CHECK-NEXT: 5: [B1.4] (Lifetime ends)
// CHECK-NEXT: 6: [B11.2] (Lifetime ends)
// CHECK-NEXT: Preds (2): B3 B6
// CHECK-NEXT: Succs (1): B10
// CHECK: [B3]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A e;
// CHECK-NEXT: 3: [B3.2] (Lifetime ends)
// CHECK-NEXT: 4: [B9.2] (Lifetime ends)
// CHECK-NEXT: Preds (1): B9
// CHECK-NEXT: Succs (1): B1
// CHECK: [B9]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A d;
// CHECK-NEXT: 3: UV
// CHECK-NEXT: 4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK: [B10]
// CHECK-NEXT: 1: b
// CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const class A)
-// CHECK-NEXT: 3: [B10.2] (CXXConstructExpr, class A)
+// CHECK-NEXT: 3: [B10.2] (CXXConstructExpr, A)
// CHECK-NEXT: 4: A c = b;
// CHECK-NEXT: 5: c
// CHECK-NEXT: 6: [B10.5] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Preds (2): B2 B11
// CHECK-NEXT: Succs (2): B9 B1
// CHECK: [B11]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A a;
-// CHECK-NEXT: 3: (CXXConstructExpr, class A)
+// CHECK-NEXT: 3: (CXXConstructExpr, A)
// CHECK-NEXT: 4: A b;
// CHECK-NEXT: Preds (1): B12
// CHECK-NEXT: Succs (1): B10
// CHECK: [B2 (ENTRY)]
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
-// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: int n;
// CHECK-NEXT: 4: n
// CHECK-NEXT: Succs (1): B0
// CHECK: [B2]
// CHECK-NEXT: label:
-// CHECK-NEXT: 1: (CXXConstructExpr, struct B)
+// CHECK-NEXT: 1: (CXXConstructExpr, B)
// CHECK-NEXT: 2: B b;
// CHECK-NEXT: 3: [B2.2] (Lifetime ends)
// CHECK-NEXT: T: goto label;
void foo(unsigned int unsignedInt, unsigned int readSize) {
// Verify the checker is working as expected.
- A* a = static_cast<A*>(malloc(sizeof(int))); // expected-warning {{Result of 'malloc' is converted to a pointer of type 'struct A', which is incompatible with sizeof operand type 'int'}}
+ A* a = static_cast<A*>(malloc(sizeof(int))); // expected-warning {{Result of 'malloc' is converted to a pointer of type 'A', which is incompatible with sizeof operand type 'int'}}
free(a);
}
void bar() {
- A *x = static_cast<A*>(calloc(10, sizeof(void*))); // expected-warning {{Result of 'calloc' is converted to a pointer of type 'struct A', which is incompatible with sizeof operand type 'void *'}}
+ A *x = static_cast<A*>(calloc(10, sizeof(void*))); // expected-warning {{Result of 'calloc' is converted to a pointer of type 'A', which is incompatible with sizeof operand type 'void *'}}
// sizeof(void*) is compatible with any pointer.
A **y = static_cast<A**>(calloc(10, sizeof(void*))); // no-warning
free(x);
}
void struct_simple_ptr(S *a) {
- clang_analyzer_dump(a); // expected-warning {{SymRegion{reg_$0<struct S * a>}}}
- clang_analyzer_dumpExtent(a); // expected-warning {{extent_$1{SymRegion{reg_$0<struct S * a>}}}}
- clang_analyzer_dumpElementCount(a); // expected-warning {{(extent_$1{SymRegion{reg_$0<struct S * a>}}) / 4}}
+ clang_analyzer_dump(a); // expected-warning {{SymRegion{reg_$0<S * a>}}}
+ clang_analyzer_dumpExtent(a); // expected-warning {{extent_$1{SymRegion{reg_$0<S * a>}}}}
+ clang_analyzer_dumpElementCount(a); // expected-warning {{(extent_$1{SymRegion{reg_$0<S * a>}}) / 4}}
}
void field_ref(S a) {
}
void field_ptr(S *a) {
- clang_analyzer_dump(&a->f); // expected-warning {{SymRegion{reg_$0<struct S * a>}.f}}
+ clang_analyzer_dump(&a->f); // expected-warning {{SymRegion{reg_$0<S * a>}.f}}
clang_analyzer_dumpExtent(&a->f); // expected-warning {{4 S64b}}
clang_analyzer_dumpElementCount(&a->f); // expected-warning {{1 S64b}}
}
// CHECK: void foo(int)
// CHECK: [B1]
-// CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], class variant_0::B)
-// CHECK-NEXT: 2: variant_0::B i;
+// CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], B)
+// CHECK-NEXT: 2: B i;
// CHECK-NEXT: 3: operator=
// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, FunctionToPointerDecay, class variant_0::B &(*)(class variant_0::B &&) noexcept)
// CHECK-NEXT: 5: i
// CHECK-NEXT: 8: [B1.7]
// CHECK-NEXT: 9: [B1.5] = [B1.8] (OperatorCall)
// CHECK-NEXT: 10: ~variant_0::B() (Temporary object destructor)
-// CHECK-NEXT: 11: [B1.2].~variant_0::B() (Implicit destructor)
+// CHECK-NEXT: 11: [B1.2].~B() (Implicit destructor)
void foo(int) {
B i;
i = {};
// destructor.
// CHECK: template<> void foo<int>(int)
// CHECK: [B1]
-// CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], class variant_1::B)
-// CHECK-NEXT: 2: variant_1::B i;
+// CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], B)
+// CHECK-NEXT: 2: B i;
// CHECK-NEXT: 3: operator=
// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, FunctionToPointerDecay, class variant_1::B &(*)(class variant_1::B &&) noexcept)
// CHECK-NEXT: 5: i
// CHECK-NEXT: 6: {} (CXXConstructExpr, class variant_1::B)
// CHECK-NEXT: 7: [B1.6]
// CHECK-NEXT: 8: [B1.5] = [B1.7] (OperatorCall)
-// CHECK-NEXT: 9: [B1.2].~variant_1::B() (Implicit destructor)
+// CHECK-NEXT: 9: [B1.2].~B() (Implicit destructor)
template <typename T> void foo(T) {
B i;
i = {};
// CHECK: template<> void foo<int>(int)
// CHECK: [B1]
-// CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], class variant_2::B)
-// CHECK-NEXT: 2: variant_2::B i;
+// CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], B)
+// CHECK-NEXT: 2: B i;
// CHECK-NEXT: 3: operator=
// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, FunctionToPointerDecay, class variant_2::B &(*)(class variant_2::B &&) noexcept)
// CHECK-NEXT: 5: i
// CHECK-NEXT: 9: [B1.8]
// CHECK-NEXT: 10: [B1.5] = [B1.9] (OperatorCall)
// CHECK-NEXT: 11: ~variant_2::B() (Temporary object destructor)
-// CHECK-NEXT: 12: [B1.2].~variant_2::B() (Implicit destructor)
+// CHECK-NEXT: 12: [B1.2].~B() (Implicit destructor)
template <typename T> void foo(T) {
B i;
i = {};
Foo x = get_foo();
}
// CHECK: void elided_assign()
-// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: (CXXConstructExpr{{.*}}, Foo)
// CXX14: ~Foo() (Temporary object destructor)
// CHECK: ~Foo() (Implicit destructor)
Bar x = (const Bar &)get_bar();
}
// CHECK: void nonelided_assign()
-// CHECK: (CXXConstructExpr{{.*}}, struct Bar)
+// CHECK: (CXXConstructExpr{{.*}}, Bar)
// CHECK: ~Bar() (Temporary object destructor)
// CHECK: ~Bar() (Implicit destructor)
Foo x(get_foo());
}
// CHECK: void elided_paren_init()
-// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: (CXXConstructExpr{{.*}}, Foo)
// CXX14: ~Foo() (Temporary object destructor)
// CHECK: ~Foo() (Implicit destructor)
Bar x((const Bar &)get_bar());
}
// CHECK: void nonelided_paren_init()
-// CHECK: (CXXConstructExpr{{.*}}, struct Bar)
+// CHECK: (CXXConstructExpr{{.*}}, Bar)
// CHECK: ~Bar() (Temporary object destructor)
// CHECK: ~Bar() (Implicit destructor)
Foo x{get_foo()};
}
// CHECK: void elided_brace_init()
-// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: (CXXConstructExpr{{.*}}, Foo)
// CXX14: ~Foo() (Temporary object destructor)
// CHECK: ~Foo() (Implicit destructor)
Bar x{(const Bar &)get_bar()};
}
// CHECK: void nonelided_brace_init()
-// CHECK: (CXXConstructExpr{{.*}}, struct Bar)
+// CHECK: (CXXConstructExpr{{.*}}, Bar)
// CHECK: ~Bar() (Temporary object destructor)
// CHECK: ~Bar() (Implicit destructor)
auto z = [x=get_foo()]() {};
}
// CHECK: void elided_lambda_capture_init()
-// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: (CXXConstructExpr{{.*}}, Foo)
// CXX14: ~(lambda at {{.*}})() (Temporary object destructor)
// CXX14: ~Foo() (Temporary object destructor)
// CHECK: ~(lambda at {{.*}})() (Implicit destructor)
auto z = [x((const Bar &)get_bar())]() {};
}
// CHECK: void nonelided_lambda_capture_init()
-// CHECK: (CXXConstructExpr{{.*}}, struct Bar)
+// CHECK: (CXXConstructExpr{{.*}}, Bar)
// CXX14: ~(lambda at {{.*}})() (Temporary object destructor)
// CHECK: ~Bar() (Temporary object destructor)
// CHECK: ~(lambda at {{.*}})() (Implicit destructor)
return ({ get_foo(); });
}
// CHECK: Foo elided_return_stmt_expr()
-// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: (CXXConstructExpr{{.*}}, Foo)
// CXX14: ~Foo() (Temporary object destructor)
-// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: (CXXConstructExpr{{.*}}, Foo)
// CXX14: ~Foo() (Temporary object destructor)
void elided_stmt_expr() {
({ get_foo(); });
}
// CHECK: void elided_stmt_expr()
-// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: (CXXConstructExpr{{.*}}, Foo)
// CXX14: ~Foo() (Temporary object destructor)
// CHECK: ~Foo() (Temporary object destructor)
}
// CHECK: void elided_stmt_expr_multiple_stmts()
// CHECK: ~Bar() (Temporary object destructor)
-// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: (CXXConstructExpr{{.*}}, Foo)
// CXX14: ~Foo() (Temporary object destructor)
// CHECK: ~Foo() (Temporary object destructor)
({ (const Bar &)get_bar(); });
}
// CHECK: void unelided_stmt_expr()
-// CHECK: (CXXConstructExpr{{.*}}, struct Bar)
+// CHECK: (CXXConstructExpr{{.*}}, Bar)
// CHECK: ~Bar() (Temporary object destructor)
// CHECK: ~Bar() (Temporary object destructor)
TwoFoos x{get_foo(), get_foo()};
}
// CHECK: void elided_aggregate_init()
-// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
-// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: (CXXConstructExpr{{.*}}, Foo)
+// CXX14: (CXXConstructExpr{{.*}}, Foo)
// CXX14: ~Foo() (Temporary object destructor)
// CXX14: ~Foo() (Temporary object destructor)
// CHECK: ~TwoFoos() (Implicit destructor)
TwoBars x{(const Bar &)get_bar(), (const Bar &)get_bar()};
}
// CHECK: void nonelided_aggregate_init()
-// CHECK: (CXXConstructExpr{{.*}}, struct Bar)
-// CHECK: (CXXConstructExpr{{.*}}, struct Bar)
+// CHECK: (CXXConstructExpr{{.*}}, Bar)
+// CHECK: (CXXConstructExpr{{.*}}, Bar)
// CHECK: ~Bar() (Temporary object destructor)
// CHECK: ~Bar() (Temporary object destructor)
// CHECK: ~TwoBars() (Implicit destructor)
return TwoFoos{get_foo(), get_foo()};
}
// CHECK: TwoFoos return_aggregate_init()
-// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
-// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: (CXXConstructExpr{{.*}}, Foo)
+// CXX14: (CXXConstructExpr{{.*}}, Foo)
// CXX14: ~TwoFoos() (Temporary object destructor)
// CXX14: ~Foo() (Temporary object destructor)
// CXX14: ~Foo() (Temporary object destructor)
puts("one destroyed before, one destroyed after");
}
// CHECK: void not_lifetime_extended()
-// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: (CXXConstructExpr{{.*}}, Foo)
// CHECK: ~Foo() (Temporary object destructor)
// CXX14: ~Foo() (Temporary object destructor)
// CHECK: one destroyed before, one destroyed after
(void)(Bar[]){{}, {}};
}
// CHECK: void compound_literal()
-// CHECK: (CXXConstructExpr, struct Bar)
-// CHECK: (CXXConstructExpr, struct Bar)
+// CHECK: (CXXConstructExpr, Bar)
+// CHECK: (CXXConstructExpr, Bar)
// CHECK: ~Bar[2]() (Temporary object destructor)
Foo elided_return() {
return get_foo();
}
// CHECK: Foo elided_return()
-// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: (CXXConstructExpr{{.*}}, Foo)
// CXX14: ~Foo() (Temporary object destructor)
auto elided_return_lambda() {
DefaultArgInCtor qux[3];
}
// CHECK: void default_ctor_with_default_arg()
-// CHECK: CXXConstructExpr, {{.*}}, struct DefaultArgInCtor[3]
+// CHECK: CXXConstructExpr, {{.*}}, DefaultArgInCtor[3]
// CXX14: ~Foo() (Temporary object destructor)
// CHECK: ~Foo() (Temporary object destructor)
// CHECK: .~DefaultArgInCtor[3]() (Implicit destructor)
new DefaultArgInCtor[count];
}
// CHECK: void new_default_ctor_with_default_arg(long count)
-// CHECK: CXXConstructExpr, {{.*}}, struct DefaultArgInCtor[]
+// CHECK: CXXConstructExpr, {{.*}}, DefaultArgInCtor[]
// CXX14: ~Foo() (Temporary object destructor)
// CHECK: ~Foo() (Temporary object destructor)
int parse(parse_t *p) {
unsigned copy = p->bits2;
clang_analyzer_dump(copy);
- // expected-warning@-1 {{reg_$1<unsigned int SymRegion{reg_$0<struct Bug_55934::parse_t * p>}.bits2>}}
+ // expected-warning@-1 {{reg_$1<unsigned int SymRegion{reg_$0<parse_t * p>}.bits2>}}
header *bits = (header *)©
clang_analyzer_dump(bits->b);
- // expected-warning@-1 {{derived_$2{reg_$1<unsigned int SymRegion{reg_$0<struct Bug_55934::parse_t * p>}.bits2>,Element{copy,0 S64b,struct Bug_55934::header}.b}}}
+ // expected-warning@-1 {{derived_$2{reg_$1<unsigned int SymRegion{reg_$0<parse_t * p>}.bits2>,Element{copy,0 S64b,struct Bug_55934::header}.b}}}
return bits->b; // no-warning
}
} // namespace Bug_55934
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
// CHECK-NEXT: 1: CFGScopeBegin(a)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B1.3], class A[2])
+// CHECK-NEXT: 2: (CXXConstructExpr, [B1.3], A[2])
// CHECK-NEXT: 3: A a[2];
-// CHECK-NEXT: 4: (CXXConstructExpr, [B1.5], class A[0])
+// CHECK-NEXT: 4: (CXXConstructExpr, [B1.5], A[0])
// CHECK-NEXT: 5: A b[0];
// CHECK-NEXT: 6: [B1.3].~A[2]() (Implicit destructor)
// CHECK-NEXT: 7: CFGScopeEnd(a)
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
// CHECK-NEXT: 1: CFGScopeBegin(a)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B1.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B1.3], A)
// CHECK-NEXT: 3: A a;
// CHECK-NEXT: 4: CFGScopeBegin(c)
-// CHECK-NEXT: 5: (CXXConstructExpr, [B1.6], class A)
+// CHECK-NEXT: 5: (CXXConstructExpr, [B1.6], A)
// CHECK-NEXT: 6: A c;
-// CHECK-NEXT: 7: (CXXConstructExpr, [B1.8], class A)
+// CHECK-NEXT: 7: (CXXConstructExpr, [B1.8], A)
// CHECK-NEXT: 8: A d;
// CHECK-NEXT: 9: [B1.8].~A() (Implicit destructor)
// CHECK-NEXT: 10: [B1.6].~A() (Implicit destructor)
// CHECK-NEXT: 11: CFGScopeEnd(c)
-// CHECK-NEXT: 12: (CXXConstructExpr, [B1.13], class A)
+// CHECK-NEXT: 12: (CXXConstructExpr, [B1.13], A)
// CHECK-NEXT: 13: A b;
// CHECK-NEXT: 14: [B1.13].~A() (Implicit destructor)
// CHECK-NEXT: 15: [B1.3].~A() (Implicit destructor)
// CHECK: [B4 (ENTRY)]
// CHECK-NEXT: Succs (1): B3
// CHECK: [B1]
-// CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B1.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B3.5].~A() (Implicit destructor)
// CHECK-NEXT: Succs (1): B0
// CHECK: [B3]
// CHECK-NEXT: 1: CFGScopeBegin(a)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B3.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B3.3], A)
// CHECK-NEXT: 3: A a;
-// CHECK-NEXT: 4: (CXXConstructExpr, [B3.5], class A)
+// CHECK-NEXT: 4: (CXXConstructExpr, [B3.5], A)
// CHECK-NEXT: 5: A b;
// CHECK-NEXT: 6: UV
// CHECK-NEXT: 7: [B3.6] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: Succs (1): B0
// CHECK: [B2]
// CHECK-NEXT: 1: CFGScopeBegin(c)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B2.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B2.3], A)
// CHECK-NEXT: 3: A c;
// CHECK-NEXT: 4: [B2.3].~A() (Implicit destructor)
// CHECK-NEXT: 5: CFGScopeEnd(c)
// CHECK-NEXT: Succs (1): B1
// CHECK: [B3]
// CHECK-NEXT: 1: CFGScopeBegin(c)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B3.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B3.3], A)
// CHECK-NEXT: 3: A c;
// CHECK-NEXT: 4: [B3.3].~A() (Implicit destructor)
// CHECK-NEXT: 5: CFGScopeEnd(c)
// CHECK-NEXT: Succs (1): B1
// CHECK: [B4]
// CHECK-NEXT: 1: CFGScopeBegin(a)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B4.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B4.3], A)
// CHECK-NEXT: 3: A a;
// CHECK-NEXT: 4: CFGScopeBegin(b)
// CHECK-NEXT: 5: a
// CHECK-NEXT: 6: [B4.5] (ImplicitCastExpr, NoOp, const class A)
-// CHECK-NEXT: 7: [B4.6] (CXXConstructExpr, [B4.8], class A)
+// CHECK-NEXT: 7: [B4.6] (CXXConstructExpr, [B4.8], A)
// CHECK-NEXT: 8: A b = a;
// CHECK-NEXT: 9: b
// CHECK-NEXT: 10: [B4.9] (ImplicitCastExpr, NoOp, const class A)
// CHECK: [B1]
// CHECK-NEXT: 1: [B8.8].~A() (Implicit destructor)
// CHECK-NEXT: 2: CFGScopeEnd(b)
-// CHECK-NEXT: 3: (CXXConstructExpr, [B1.4], class A)
+// CHECK-NEXT: 3: (CXXConstructExpr, [B1.4], A)
// CHECK-NEXT: 4: A e;
// CHECK-NEXT: 5: [B1.4].~A() (Implicit destructor)
// CHECK-NEXT: 6: [B8.3].~A() (Implicit destructor)
// CHECK-NEXT: Preds (2): B2 B5
// CHECK-NEXT: Succs (1): B0
// CHECK: [B2]
-// CHECK-NEXT: 1: (CXXConstructExpr, [B2.2], class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, [B2.2], A)
// CHECK-NEXT: 2: A d;
// CHECK-NEXT: 3: [B2.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B4.3].~A() (Implicit destructor)
// CHECK-NEXT: Succs (1): B0
// CHECK: [B4]
// CHECK-NEXT: 1: CFGScopeBegin(c)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B4.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B4.3], A)
// CHECK-NEXT: 3: A c;
// CHECK-NEXT: 4: UV
// CHECK-NEXT: 5: [B4.4] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: Preds (1): B8
// CHECK-NEXT: Succs (2): B3 B2
// CHECK: [B5]
-// CHECK-NEXT: 1: (CXXConstructExpr, [B5.2], class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, [B5.2], A)
// CHECK-NEXT: 2: A d;
// CHECK-NEXT: 3: [B5.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B7.3].~A() (Implicit destructor)
// CHECK-NEXT: Succs (1): B0
// CHECK: [B7]
// CHECK-NEXT: 1: CFGScopeBegin(c)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B7.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B7.3], A)
// CHECK-NEXT: 3: A c;
// CHECK-NEXT: 4: UV
// CHECK-NEXT: 5: [B7.4] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: Succs (2): B6 B5
// CHECK: [B8]
// CHECK-NEXT: 1: CFGScopeBegin(a)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B8.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B8.3], A)
// CHECK-NEXT: 3: A a;
// CHECK-NEXT: 4: CFGScopeBegin(b)
// CHECK-NEXT: 5: a
// CHECK-NEXT: 6: [B8.5] (ImplicitCastExpr, NoOp, const class A)
-// CHECK-NEXT: 7: [B8.6] (CXXConstructExpr, [B8.8], class A)
+// CHECK-NEXT: 7: [B8.6] (CXXConstructExpr, [B8.8], A)
// CHECK-NEXT: 8: A b = a;
// CHECK-NEXT: 9: b
// CHECK-NEXT: 10: [B8.9] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Succs (1): B4
// CHECK: [B3]
// CHECK-NEXT: 1: CFGScopeBegin(c)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B3.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B3.3], A)
// CHECK-NEXT: 3: A c;
// CHECK-NEXT: 4: [B3.3].~A() (Implicit destructor)
// CHECK-NEXT: 5: CFGScopeEnd(c)
// CHECK-NEXT: 1: CFGScopeBegin(b)
// CHECK-NEXT: 2: a
// CHECK-NEXT: 3: [B4.2] (ImplicitCastExpr, NoOp, const class A)
-// CHECK-NEXT: 4: [B4.3] (CXXConstructExpr, [B4.5], class A)
+// CHECK-NEXT: 4: [B4.3] (CXXConstructExpr, [B4.5], A)
// CHECK-NEXT: 5: A b = a;
// CHECK-NEXT: 6: b
// CHECK-NEXT: 7: [B4.6] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Succs (2): B3 B1
// CHECK: [B5]
// CHECK-NEXT: 1: CFGScopeBegin(a)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B5.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B5.3], A)
// CHECK-NEXT: 3: A a;
// CHECK-NEXT: Preds (1): B6
// CHECK-NEXT: Succs (1): B4
// CHECK: [B1]
// CHECK-NEXT: 1: [B10.5].~A() (Implicit destructor)
// CHECK-NEXT: 2: CFGScopeEnd(b)
-// CHECK-NEXT: 3: (CXXConstructExpr, [B1.4], class A)
+// CHECK-NEXT: 3: (CXXConstructExpr, [B1.4], A)
// CHECK-NEXT: 4: A e;
// CHECK-NEXT: 5: [B1.4].~A() (Implicit destructor)
// CHECK-NEXT: 6: [B11.3].~A() (Implicit destructor)
// CHECK-NEXT: Preds (2): B3 B6
// CHECK-NEXT: Succs (1): B10
// CHECK: [B3]
-// CHECK-NEXT: 1: (CXXConstructExpr, [B3.2], class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, [B3.2], A)
// CHECK-NEXT: 2: A d;
// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B9.3].~A() (Implicit destructor)
// CHECK-NEXT: Succs (1): B1
// CHECK: [B9]
// CHECK-NEXT: 1: CFGScopeBegin(c)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B9.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B9.3], A)
// CHECK-NEXT: 3: A c;
// CHECK-NEXT: 4: UV
// CHECK-NEXT: 5: [B9.4] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: 1: CFGScopeBegin(b)
// CHECK-NEXT: 2: a
// CHECK-NEXT: 3: [B10.2] (ImplicitCastExpr, NoOp, const class A)
-// CHECK-NEXT: 4: [B10.3] (CXXConstructExpr, [B10.5], class A)
+// CHECK-NEXT: 4: [B10.3] (CXXConstructExpr, [B10.5], A)
// CHECK-NEXT: 5: A b = a;
// CHECK-NEXT: 6: b
// CHECK-NEXT: 7: [B10.6] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Succs (2): B9 B1
// CHECK: [B11]
// CHECK-NEXT: 1: CFGScopeBegin(a)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B11.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B11.3], A)
// CHECK-NEXT: 3: A a;
// CHECK-NEXT: Preds (1): B12
// CHECK-NEXT: Succs (1): B10
// CHECK: [B12 (ENTRY)]
// CHECK-NEXT: Succs (1): B11
// CHECK: [B1]
-// CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], A)
// CHECK-NEXT: 2: A d;
// CHECK-NEXT: 3: [B1.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B11.3].~A() (Implicit destructor)
// CHECK-NEXT: Preds (2): B3 B6
// CHECK-NEXT: Succs (2): B10 B1
// CHECK: [B3]
-// CHECK-NEXT: 1: (CXXConstructExpr, [B3.2], class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, [B3.2], A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B9.3].~A() (Implicit destructor)
// CHECK-NEXT: Succs (1): B1
// CHECK: [B9]
// CHECK-NEXT: 1: CFGScopeBegin(b)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B9.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B9.3], A)
// CHECK-NEXT: 3: A b;
// CHECK-NEXT: 4: UV
// CHECK-NEXT: 5: [B9.4] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: Succs (1): B9
// CHECK: [B11]
// CHECK-NEXT: 1: CFGScopeBegin(a)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B11.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B11.3], A)
// CHECK-NEXT: 3: A a;
// CHECK-NEXT: Preds (1): B12
// CHECK-NEXT: Succs (1): B9
// CHECK-NEXT: Succs (1): B4
// CHECK: [B3]
// CHECK-NEXT: 1: CFGScopeBegin(c)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B3.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B3.3], A)
// CHECK-NEXT: 3: A c;
// CHECK-NEXT: 4: [B3.3].~A() (Implicit destructor)
// CHECK-NEXT: 5: CFGScopeEnd(c)
// CHECK-NEXT: 1: CFGScopeBegin(b)
// CHECK-NEXT: 2: a
// CHECK-NEXT: 3: [B4.2] (ImplicitCastExpr, NoOp, const class A)
-// CHECK-NEXT: 4: [B4.3] (CXXConstructExpr, [B4.5], class A)
+// CHECK-NEXT: 4: [B4.3] (CXXConstructExpr, [B4.5], A)
// CHECK-NEXT: 5: A b = a;
// CHECK-NEXT: 6: b
// CHECK-NEXT: 7: [B4.6] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Succs (2): B3 B1
// CHECK: [B5]
// CHECK-NEXT: 1: CFGScopeBegin(a)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B5.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B5.3], A)
// CHECK-NEXT: 3: A a;
// CHECK-NEXT: Preds (1): B6
// CHECK-NEXT: Succs (1): B4
// CHECK-NEXT: 2: CFGScopeEnd(c)
// CHECK-NEXT: 3: [B11.6].~A() (Implicit destructor)
// CHECK-NEXT: 4: CFGScopeEnd(b)
-// CHECK-NEXT: 5: (CXXConstructExpr, [B1.6], class A)
+// CHECK-NEXT: 5: (CXXConstructExpr, [B1.6], A)
// CHECK-NEXT: 6: A f;
// CHECK-NEXT: 7: [B1.6].~A() (Implicit destructor)
// CHECK-NEXT: 8: [B11.3].~A() (Implicit destructor)
// CHECK-NEXT: Preds (2): B3 B6
// CHECK-NEXT: Succs (1): B10
// CHECK: [B3]
-// CHECK-NEXT: 1: (CXXConstructExpr, [B3.2], class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, [B3.2], A)
// CHECK-NEXT: 2: A e;
// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B9.3].~A() (Implicit destructor)
// CHECK-NEXT: Succs (1): B1
// CHECK: [B9]
// CHECK-NEXT: 1: CFGScopeBegin(d)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B9.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B9.3], A)
// CHECK-NEXT: 3: A d;
// CHECK-NEXT: 4: UV
// CHECK-NEXT: 5: [B9.4] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: 1: CFGScopeBegin(c)
// CHECK-NEXT: 2: b
// CHECK-NEXT: 3: [B10.2] (ImplicitCastExpr, NoOp, const class A)
-// CHECK-NEXT: 4: [B10.3] (CXXConstructExpr, [B10.5], class A)
+// CHECK-NEXT: 4: [B10.3] (CXXConstructExpr, [B10.5], A)
// CHECK-NEXT: 5: A c = b;
// CHECK-NEXT: 6: c
// CHECK-NEXT: 7: [B10.6] (ImplicitCastExpr, NoOp, const class A)
// CHECK-NEXT: Succs (2): B9 B1
// CHECK: [B11]
// CHECK-NEXT: 1: CFGScopeBegin(a)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B11.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B11.3], A)
// CHECK-NEXT: 3: A a;
// CHECK-NEXT: 4: CFGScopeBegin(b)
-// CHECK-NEXT: 5: (CXXConstructExpr, [B11.6], class A)
+// CHECK-NEXT: 5: (CXXConstructExpr, [B11.6], A)
// CHECK-NEXT: 6: A b;
// CHECK-NEXT: Preds (1): B12
// CHECK-NEXT: Succs (1): B10
// CHECK-NEXT: Succs (1): B7
// CHECK: [B1]
// CHECK-NEXT: l1:
-// CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], A)
// CHECK-NEXT: 2: A c;
// CHECK-NEXT: 3: [B1.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B6.5].~A() (Implicit destructor)
// CHECK-NEXT: Preds (2): B2 B3
// CHECK-NEXT: Succs (1): B0
// CHECK: [B2]
-// CHECK-NEXT: 1: (CXXConstructExpr, [B2.2], class A)
+// CHECK-NEXT: 1: (CXXConstructExpr, [B2.2], A)
// CHECK-NEXT: 2: A b;
// CHECK-NEXT: 3: [B2.2].~A() (Implicit destructor)
// CHECK-NEXT: 4: [B6.8].~A() (Implicit destructor)
// CHECK: [B6]
// CHECK-NEXT: l0:
// CHECK-NEXT: 1: CFGScopeBegin(cb)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B6.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B6.3], A)
// CHECK-NEXT: 3: A cb;
-// CHECK-NEXT: 4: (CXXConstructExpr, [B6.5], class A)
+// CHECK-NEXT: 4: (CXXConstructExpr, [B6.5], A)
// CHECK-NEXT: 5: A b;
// CHECK-NEXT: 6: CFGScopeBegin(a)
-// CHECK-NEXT: 7: (CXXConstructExpr, [B6.8], class A)
+// CHECK-NEXT: 7: (CXXConstructExpr, [B6.8], A)
// CHECK-NEXT: 8: A a;
// CHECK-NEXT: 9: UV
// CHECK-NEXT: 10: [B6.9] (ImplicitCastExpr, LValueToRValue, _Bool)
// CHECK-NEXT: Succs (2): B5 B4
// CHECK: [B7]
// CHECK-NEXT: 1: CFGScopeBegin(a)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B7.3], class A)
+// CHECK-NEXT: 2: (CXXConstructExpr, [B7.3], A)
// CHECK-NEXT: 3: A a;
// CHECK-NEXT: Preds (1): B8
// CHECK-NEXT: Succs (1): B6
// CHECK-NEXT: Succs (1): B0
// CHECK: [B2]
// CHECK-NEXT: 1: __begin1
-// CHECK-NEXT: 2: [B2.1] (ImplicitCastExpr, LValueToRValue, class A *)
+// CHECK-NEXT: 2: [B2.1] (ImplicitCastExpr, LValueToRValue, A *)
// CHECK-NEXT: 3: __end1
-// CHECK-NEXT: 4: [B2.3] (ImplicitCastExpr, LValueToRValue, class A *)
+// CHECK-NEXT: 4: [B2.3] (ImplicitCastExpr, LValueToRValue, A *)
// CHECK-NEXT: 5: [B2.2] != [B2.4]
// CHECK-NEXT: T: for (auto &i : [B5.4])
// CHECK: [B4.11];
// CHECK: [B4]
// CHECK-NEXT: 1: CFGScopeBegin(i)
// CHECK-NEXT: 2: __begin1
-// CHECK-NEXT: 3: [B4.2] (ImplicitCastExpr, LValueToRValue, class A *)
+// CHECK-NEXT: 3: [B4.2] (ImplicitCastExpr, LValueToRValue, A *)
// CHECK-NEXT: 4: *[B4.3]
// CHECK-NEXT: 5: auto &i
// CHECK-NEXT: 6: operator=
// CHECK-NEXT: Succs (1): B3
// CHECK: [B5]
// CHECK-NEXT: 1: CFGScopeBegin(a)
-// CHECK-NEXT: 2: (CXXConstructExpr, [B5.3], class A[10])
+// CHECK-NEXT: 2: (CXXConstructExpr, [B5.3], A[10])
// CHECK-NEXT: 3: A a[10];
// CHECK-NEXT: 4: a
// CHECK-NEXT: 5: auto &&__range1 = a;
// CHECK-NEXT: 6: CFGScopeBegin(__end1)
// CHECK-NEXT: 7: __range1
-// CHECK-NEXT: 8: [B5.7] (ImplicitCastExpr, ArrayToPointerDecay, class A *)
+// CHECK-NEXT: 8: [B5.7] (ImplicitCastExpr, ArrayToPointerDecay, A *)
// CHECK-NEXT: 9: 10
// CHECK-NEXT: 10: [B5.8] + [B5.9]
// CHECK-NEXT: 11: auto __end1 = __range1 + 10
// CHECK-NEXT: 12: __range1
-// CHECK-NEXT: 13: [B5.12] (ImplicitCastExpr, ArrayToPointerDecay, class A *)
+// CHECK-NEXT: 13: [B5.12] (ImplicitCastExpr, ArrayToPointerDecay, A *)
// CHECK-NEXT: 14: auto __begin1 = __range1;
// CHECK-NEXT: Preds (1): B6
// CHECK-NEXT: Succs (1): B2
// CHECK: [B2 (ENTRY)]
// CHECK: Succs (1): B1
// CHECK: [B1]
-// WARNINGS: 1: A() (CXXConstructExpr, class A)
-// ANALYZER: 1: A() (CXXConstructExpr, [B1.2], [B1.4], [B1.5], class A)
+// WARNINGS: 1: A() (CXXConstructExpr, A)
+// ANALYZER: 1: A() (CXXConstructExpr, [B1.2], [B1.4], [B1.5], A)
// CHECK: 2: [B1.1] (BindTemporary)
-// CHECK: 3: [B1.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 3: [B1.2] (ImplicitCastExpr, NoOp, const A)
// CHECK: 4: [B1.3]
-// WARNINGS: 5: [B1.4] (CXXConstructExpr, class A)
-// ANALYZER: 5: [B1.4] (CXXConstructExpr, [B1.7], class A)
+// WARNINGS: 5: [B1.4] (CXXConstructExpr, A)
+// ANALYZER: 5: [B1.4] (CXXConstructExpr, [B1.7], A)
// CHECK: 6: ~A() (Temporary object destructor)
// CHECK: 7: return [B1.5];
// CHECK: Preds (1): B2
// CHECK: [B2 (ENTRY)]
// CHECK: Succs (1): B1
// CHECK: [B1]
-// WARNINGS: 1: A() (CXXConstructExpr, class A)
-// ANALYZER: 1: A() (CXXConstructExpr, [B1.2], [B1.4], [B1.5], class A)
+// WARNINGS: 1: A() (CXXConstructExpr, A)
+// ANALYZER: 1: A() (CXXConstructExpr, [B1.2], [B1.4], [B1.5], A)
// CHECK: 2: [B1.1] (BindTemporary)
-// CHECK: 3: [B1.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 3: [B1.2] (ImplicitCastExpr, NoOp, const A)
// CHECK: 4: [B1.3]
-// WARNINGS: 5: [B1.4] (CXXConstructExpr, class A)
-// ANALYZER: 5: [B1.4] (CXXConstructExpr, [B1.7], class A)
+// WARNINGS: 5: [B1.4] (CXXConstructExpr, A)
+// ANALYZER: 5: [B1.4] (CXXConstructExpr, [B1.7], A)
// CHECK: 6: ~A() (Temporary object destructor)
// CHECK: 7: return [B1.5];
// CHECK: Preds (1): B2
// CHECK: [B2 (ENTRY)]
// CHECK: Succs (1): B1
// CHECK: [B1]
-// WARNINGS: 1: A() (CXXConstructExpr, class A)
-// ANALYZER: 1: A() (CXXConstructExpr, [B1.2], [B1.3], class A)
+// WARNINGS: 1: A() (CXXConstructExpr, A)
+// ANALYZER: 1: A() (CXXConstructExpr, [B1.2], [B1.3], A)
// CHECK: 2: [B1.1] (BindTemporary)
// CHECK: 3: [B1.2]
// CHECK: 4: [B1.3].operator int
// CHECK: 5: [B1.3]
// CHECK: 6: [B1.5] (ImplicitCastExpr, UserDefinedConversion, int)
// CHECK: 7: int([B1.6]) (CXXFunctionalCastExpr, NoOp, int)
-// WARNINGS: 8: B() (CXXConstructExpr, class B)
-// ANALYZER: 8: B() (CXXConstructExpr, [B1.9], [B1.10], class B)
+// WARNINGS: 8: B() (CXXConstructExpr, B)
+// ANALYZER: 8: B() (CXXConstructExpr, [B1.9], [B1.10], B)
// CHECK: 9: [B1.8] (BindTemporary)
// CHECK: 10: [B1.9]
// CHECK: 11: [B1.10].operator int
// CHECK: 18: ~A() (Temporary object destructor)
// CHECK: 19: foo
// CHECK: 20: [B1.19] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(int))
-// WARNINGS: 21: A() (CXXConstructExpr, class A)
-// ANALYZER: 21: A() (CXXConstructExpr, [B1.22], [B1.23], class A)
+// WARNINGS: 21: A() (CXXConstructExpr, A)
+// ANALYZER: 21: A() (CXXConstructExpr, [B1.22], [B1.23], A)
// CHECK: 22: [B1.21] (BindTemporary)
// CHECK: 23: [B1.22]
// CHECK: 24: [B1.23].operator int
// CHECK: 25: [B1.23]
// CHECK: 26: [B1.25] (ImplicitCastExpr, UserDefinedConversion, int)
// CHECK: 27: int([B1.26]) (CXXFunctionalCastExpr, NoOp, int)
-// WARNINGS: 28: B() (CXXConstructExpr, class B)
-// ANALYZER: 28: B() (CXXConstructExpr, [B1.29], [B1.30], class B)
+// WARNINGS: 28: B() (CXXConstructExpr, B)
+// ANALYZER: 28: B() (CXXConstructExpr, [B1.29], [B1.30], B)
// CHECK: 29: [B1.28] (BindTemporary)
// CHECK: 30: [B1.29]
// CHECK: 31: [B1.30].operator int
// CHECK: Preds (2): B4 B5
// CHECK: Succs (2): B2 B1
// CHECK: [B4]
-// WARNINGS: 1: B() (CXXConstructExpr, class B)
-// ANALYZER: 1: B() (CXXConstructExpr, [B4.2], [B4.3], class B)
+// WARNINGS: 1: B() (CXXConstructExpr, B)
+// ANALYZER: 1: B() (CXXConstructExpr, [B4.2], [B4.3], B)
// CHECK: 2: [B4.1] (BindTemporary)
// CHECK: 3: [B4.2]
// CHECK: 4: [B4.3].operator bool
// CHECK: 1: ~A() (Temporary object destructor)
// CHECK: 2: foo
// CHECK: 3: [B5.2] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(_Bool))
-// WARNINGS: 4: A() (CXXConstructExpr, class A)
-// ANALYZER: 4: A() (CXXConstructExpr, [B5.5], [B5.6], class A)
+// WARNINGS: 4: A() (CXXConstructExpr, A)
+// ANALYZER: 4: A() (CXXConstructExpr, [B5.5], [B5.6], A)
// CHECK: 5: [B5.4] (BindTemporary)
// CHECK: 6: [B5.5]
// CHECK: 7: [B5.6].operator bool
// CHECK: Preds (2): B8 B9
// CHECK: Succs (2): B6 B5
// CHECK: [B8]
-// WARNINGS: 1: B() (CXXConstructExpr, class B)
-// ANALYZER: 1: B() (CXXConstructExpr, [B8.2], [B8.3], class B)
+// WARNINGS: 1: B() (CXXConstructExpr, B)
+// ANALYZER: 1: B() (CXXConstructExpr, [B8.2], [B8.3], B)
// CHECK: 2: [B8.1] (BindTemporary)
// CHECK: 3: [B8.2]
// CHECK: 4: [B8.3].operator bool
// CHECK: Preds (1): B9
// CHECK: Succs (1): B7
// CHECK: [B9]
-// WARNINGS: 1: A() (CXXConstructExpr, class A)
-// ANALYZER: 1: A() (CXXConstructExpr, [B9.2], [B9.3], class A)
+// WARNINGS: 1: A() (CXXConstructExpr, A)
+// ANALYZER: 1: A() (CXXConstructExpr, [B9.2], [B9.3], A)
// CHECK: 2: [B9.1] (BindTemporary)
// CHECK: 3: [B9.2]
// CHECK: 4: [B9.3].operator bool
// CHECK: Preds (2): B4 B5
// CHECK: Succs (2): B2 B1
// CHECK: [B4]
-// WARNINGS: 1: B() (CXXConstructExpr, class B)
-// ANALYZER: 1: B() (CXXConstructExpr, [B4.2], [B4.3], class B)
+// WARNINGS: 1: B() (CXXConstructExpr, B)
+// ANALYZER: 1: B() (CXXConstructExpr, [B4.2], [B4.3], B)
// CHECK: 2: [B4.1] (BindTemporary)
// CHECK: 3: [B4.2]
// CHECK: 4: [B4.3].operator bool
// CHECK: 1: ~A() (Temporary object destructor)
// CHECK: 2: foo
// CHECK: 3: [B5.2] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(_Bool))
-// WARNINGS: 4: A() (CXXConstructExpr, class A)
-// ANALYZER: 4: A() (CXXConstructExpr, [B5.5], [B5.6], class A)
+// WARNINGS: 4: A() (CXXConstructExpr, A)
+// ANALYZER: 4: A() (CXXConstructExpr, [B5.5], [B5.6], A)
// CHECK: 5: [B5.4] (BindTemporary)
// CHECK: 6: [B5.5]
// CHECK: 7: [B5.6].operator bool
// CHECK: Preds (2): B8 B9
// CHECK: Succs (2): B6 B5
// CHECK: [B8]
-// WARNINGS: 1: B() (CXXConstructExpr, class B)
-// ANALYZER: 1: B() (CXXConstructExpr, [B8.2], [B8.3], class B)
+// WARNINGS: 1: B() (CXXConstructExpr, B)
+// ANALYZER: 1: B() (CXXConstructExpr, [B8.2], [B8.3], B)
// CHECK: 2: [B8.1] (BindTemporary)
// CHECK: 3: [B8.2]
// CHECK: 4: [B8.3].operator bool
// CHECK: Preds (1): B9
// CHECK: Succs (1): B7
// CHECK: [B9]
-// WARNINGS: 1: A() (CXXConstructExpr, class A)
-// ANALYZER: 1: A() (CXXConstructExpr, [B9.2], [B9.3], class A)
+// WARNINGS: 1: A() (CXXConstructExpr, A)
+// ANALYZER: 1: A() (CXXConstructExpr, [B9.2], [B9.3], A)
// CHECK: 2: [B9.1] (BindTemporary)
// CHECK: 3: [B9.2]
// CHECK: 4: [B9.3].operator bool
// CHECK: Succs (1): B1
// CHECK: [B4]
// CHECK: 1: ~B() (Temporary object destructor)
-// WARNINGS: 2: B() (CXXConstructExpr, class B)
-// ANALYZER: 2: B() (CXXConstructExpr, [B4.3], [B4.4], class B)
+// WARNINGS: 2: B() (CXXConstructExpr, B)
+// ANALYZER: 2: B() (CXXConstructExpr, [B4.3], [B4.4], B)
// CHECK: 3: [B4.2] (BindTemporary)
// CHECK: 4: [B4.3]
// CHECK: 5: [B4.4].operator bool
// CHECK: Succs (1): B4
// CHECK: [B7]
// CHECK: 1: [B10.6] ? [B8.6] : [B9.16]
-// CHECK: 2: [B7.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 2: [B7.1] (ImplicitCastExpr, NoOp, const A)
// CHECK: 3: [B7.2]
-// WARNINGS: 4: [B7.3] (CXXConstructExpr, class A)
-// ANALYZER: 4: [B7.3] (CXXConstructExpr, [B7.5], class A)
+// WARNINGS: 4: [B7.3] (CXXConstructExpr, A)
+// ANALYZER: 4: [B7.3] (CXXConstructExpr, [B7.5], A)
// CHECK: 5: A a = B() ? A() : A(B());
// CHECK: T: (Temp Dtor) [B9.2]
// CHECK: Preds (2): B8 B9
// CHECK: Succs (2): B6 B5
// CHECK: [B8]
-// WARNINGS: 1: A() (CXXConstructExpr, class A)
-// ANALYZER: 1: A() (CXXConstructExpr, [B8.2], [B8.4], [B8.5], class A)
+// WARNINGS: 1: A() (CXXConstructExpr, A)
+// ANALYZER: 1: A() (CXXConstructExpr, [B8.2], [B8.4], [B8.5], A)
// CHECK: 2: [B8.1] (BindTemporary)
-// CHECK: 3: [B8.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 3: [B8.2] (ImplicitCastExpr, NoOp, const A)
// CHECK: 4: [B8.3]
-// WARNINGS: 5: [B8.4] (CXXConstructExpr, class A)
-// ANALYZER: 5: [B8.4] (CXXConstructExpr, [B8.6], [B7.3], [B7.4], class A)
+// WARNINGS: 5: [B8.4] (CXXConstructExpr, A)
+// ANALYZER: 5: [B8.4] (CXXConstructExpr, [B8.6], [B7.3], [B7.4], A)
// CHECK: 6: [B8.5] (BindTemporary)
// CHECK: Preds (1): B10
// CHECK: Succs (1): B7
// CHECK: [B9]
-// WARNINGS: 1: B() (CXXConstructExpr, class B)
-// ANALYZER: 1: B() (CXXConstructExpr, [B9.2], [B9.3], class B)
+// WARNINGS: 1: B() (CXXConstructExpr, B)
+// ANALYZER: 1: B() (CXXConstructExpr, [B9.2], [B9.3], B)
// CHECK: 2: [B9.1] (BindTemporary)
// CHECK: 3: [B9.2]
// CHECK: 4: [B9.3].operator A
// CHECK: 5: [B9.3]
-// CHECK: 6: [B9.5] (ImplicitCastExpr, UserDefinedConversion, class A)
+// CHECK: 6: [B9.5] (ImplicitCastExpr, UserDefinedConversion, A)
// CHECK: 7: [B9.6] (BindTemporary)
-// CHECK: 8: [B9.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 8: [B9.7] (ImplicitCastExpr, NoOp, const A)
// CHECK: 9: [B9.8]
-// WARNINGS: 10: [B9.9] (CXXConstructExpr, class A)
-// ANALYZER: 10: [B9.9] (CXXConstructExpr, [B9.11], [B9.14], [B9.15], class A)
+// WARNINGS: 10: [B9.9] (CXXConstructExpr, A)
+// ANALYZER: 10: [B9.9] (CXXConstructExpr, [B9.11], [B9.14], [B9.15], A)
// CHECK: 11: [B9.10] (BindTemporary)
-// CHECK: 12: A([B9.11]) (CXXFunctionalCastExpr, ConstructorConversion, class A)
-// CHECK: 13: [B9.12] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 12: A([B9.11]) (CXXFunctionalCastExpr, ConstructorConversion, A)
+// CHECK: 13: [B9.12] (ImplicitCastExpr, NoOp, const A)
// CHECK: 14: [B9.13]
-// WARNINGS: 15: [B9.14] (CXXConstructExpr, class A)
-// ANALYZER: 15: [B9.14] (CXXConstructExpr, [B9.16], [B7.3], [B7.4], class A)
+// WARNINGS: 15: [B9.14] (CXXConstructExpr, A)
+// ANALYZER: 15: [B9.14] (CXXConstructExpr, [B9.16], [B7.3], [B7.4], A)
// CHECK: 16: [B9.15] (BindTemporary)
// CHECK: Preds (1): B10
// CHECK: Succs (1): B7
// CHECK: [B10]
-// WARNINGS: 1: B() (CXXConstructExpr, class B)
-// ANALYZER: 1: B() (CXXConstructExpr, [B10.2], [B10.3], class B)
+// WARNINGS: 1: B() (CXXConstructExpr, B)
+// ANALYZER: 1: B() (CXXConstructExpr, [B10.2], [B10.3], B)
// CHECK: 2: [B10.1] (BindTemporary)
// CHECK: 3: [B10.2]
// CHECK: 4: [B10.3].operator bool
// CHECK: Preds (1): B3
// CHECK: Succs (1): B0
// CHECK: [B3]
-// WARNINGS: 1: C() (CXXConstructExpr, struct C)
-// ANALYZER: 1: C() (CXXConstructExpr, [B3.2], [B3.3], struct C)
+// WARNINGS: 1: C() (CXXConstructExpr, C)
+// ANALYZER: 1: C() (CXXConstructExpr, [B3.2], [B3.3], C)
// CHECK: 2: [B3.1] (BindTemporary)
// CHECK: 3: [B3.2]
// CHECK: 4: [B3.3].operator bool
// CHECK: Preds (1): B4
// CHECK: Succs (1): B0
// CHECK: [B4]
-// WARNINGS: 1: C() (CXXConstructExpr, struct C)
-// ANALYZER: 1: C() (CXXConstructExpr, [B4.2], [B4.4], [B4.5], struct C)
+// WARNINGS: 1: C() (CXXConstructExpr, C)
+// ANALYZER: 1: C() (CXXConstructExpr, [B4.2], [B4.4], [B4.5], C)
// CHECK: 2: [B4.1] (BindTemporary)
-// CHECK: 3: [B4.2] (ImplicitCastExpr, NoOp, const struct C)
+// CHECK: 3: [B4.2] (ImplicitCastExpr, NoOp, const C)
// CHECK: 4: [B4.3]
-// WARNINGS: 5: [B4.4] (CXXConstructExpr, struct C)
-// ANALYZER: 5: [B4.4] (CXXConstructExpr, [B4.6], struct C)
+// WARNINGS: 5: [B4.4] (CXXConstructExpr, C)
+// ANALYZER: 5: [B4.4] (CXXConstructExpr, [B4.6], C)
// CHECK: 6: C c = C();
// CHECK: 7: ~C() (Temporary object destructor)
// CHECK: 8: c
// CHECK: Preds (1): B3
// CHECK: Succs (1): B0
// CHECK: [B3]
-// WARNINGS: 1: D() (CXXConstructExpr, struct D)
-// ANALYZER: 1: D() (CXXConstructExpr, [B3.2], struct D)
+// WARNINGS: 1: D() (CXXConstructExpr, D)
+// ANALYZER: 1: D() (CXXConstructExpr, [B3.2], D)
// CHECK: 2: [B3.1]
// CHECK: 3: [B3.2].operator bool
// CHECK: 4: [B3.2]
// CHECK: Preds (1): B3
// CHECK: Succs (1): B0
// CHECK: [B3]
-// CXX98-WARNINGS: 1: D() (CXXConstructExpr, struct D)
-// CXX98-ANALYZER: 1: D() (CXXConstructExpr, [B3.3], [B3.4], struct D)
-// CXX98: 2: [B3.1] (ImplicitCastExpr, NoOp, const struct D)
+// CXX98-WARNINGS: 1: D() (CXXConstructExpr, D)
+// CXX98-ANALYZER: 1: D() (CXXConstructExpr, [B3.3], [B3.4], D)
+// CXX98: 2: [B3.1] (ImplicitCastExpr, NoOp, const D)
// CXX98: 3: [B3.2]
-// CXX98-WARNINGS: 4: [B3.3] (CXXConstructExpr, struct D)
-// CXX98-ANALYZER: 4: [B3.3] (CXXConstructExpr, [B3.5], struct D)
+// CXX98-WARNINGS: 4: [B3.3] (CXXConstructExpr, D)
+// CXX98-ANALYZER: 4: [B3.3] (CXXConstructExpr, [B3.5], D)
// CXX98: 5: D d = D();
// CXX98: 6: d
// CXX98: 7: [B3.6].operator bool
// CXX98: 8: [B3.6]
// CXX98: 9: [B3.8] (ImplicitCastExpr, UserDefinedConversion, _Bool)
// CXX98: T: if [B3.9]
-// CXX11-WARNINGS: 1: D() (CXXConstructExpr, struct D)
-// CXX11-ANALYZER: 1: D() (CXXConstructExpr, [B3.2], [B3.3], struct D)
+// CXX11-WARNINGS: 1: D() (CXXConstructExpr, D)
+// CXX11-ANALYZER: 1: D() (CXXConstructExpr, [B3.2], [B3.3], D)
// CXX11: 2: [B3.1]
-// CXX11-WARNINGS: 3: [B3.2] (CXXConstructExpr, struct D)
-// CXX11-ANALYZER: 3: [B3.2] (CXXConstructExpr, [B3.4], struct D)
+// CXX11-WARNINGS: 3: [B3.2] (CXXConstructExpr, D)
+// CXX11-ANALYZER: 3: [B3.2] (CXXConstructExpr, [B3.4], D)
// CXX11: 4: D d = D();
// CXX11: 5: d
// CXX11: 6: [B3.5].operator bool
// CHECK: Succs (1): B1
// CHECK: [B4]
// CHECK: 1: [B7.9] ? [B5.6] : [B6.16]
-// CHECK: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 2: [B4.1] (ImplicitCastExpr, NoOp, const A)
// CHECK: 3: [B4.2]
// CHECK: 4: [B7.3]([B4.3])
// CHECK: T: (Temp Dtor) [B6.2]
// CHECK: Preds (2): B5 B6
// CHECK: Succs (2): B3 B2
// CHECK: [B5]
-// WARNINGS: 1: A() (CXXConstructExpr, class A)
-// ANALYZER: 1: A() (CXXConstructExpr, [B5.2], [B5.4], [B5.5], class A)
+// WARNINGS: 1: A() (CXXConstructExpr, A)
+// ANALYZER: 1: A() (CXXConstructExpr, [B5.2], [B5.4], [B5.5], A)
// CHECK: 2: [B5.1] (BindTemporary)
-// CHECK: 3: [B5.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 3: [B5.2] (ImplicitCastExpr, NoOp, const A)
// CHECK: 4: [B5.3]
-// WARNINGS: 5: [B5.4] (CXXConstructExpr, class A)
-// ANALYZER: 5: [B5.4] (CXXConstructExpr, [B5.6], [B4.3], class A)
+// WARNINGS: 5: [B5.4] (CXXConstructExpr, A)
+// ANALYZER: 5: [B5.4] (CXXConstructExpr, [B5.6], [B4.3], A)
// CHECK: 6: [B5.5] (BindTemporary)
// CHECK: Preds (1): B7
// CHECK: Succs (1): B4
// CHECK: [B6]
-// WARNINGS: 1: B() (CXXConstructExpr, class B)
-// ANALYZER: 1: B() (CXXConstructExpr, [B6.2], [B6.3], class B)
+// WARNINGS: 1: B() (CXXConstructExpr, B)
+// ANALYZER: 1: B() (CXXConstructExpr, [B6.2], [B6.3], B)
// CHECK: 2: [B6.1] (BindTemporary)
// CHECK: 3: [B6.2]
// CHECK: 4: [B6.3].operator A
// CHECK: 5: [B6.3]
-// CHECK: 6: [B6.5] (ImplicitCastExpr, UserDefinedConversion, class A)
+// CHECK: 6: [B6.5] (ImplicitCastExpr, UserDefinedConversion, A)
// CHECK: 7: [B6.6] (BindTemporary)
-// CHECK: 8: [B6.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 8: [B6.7] (ImplicitCastExpr, NoOp, const A)
// CHECK: 9: [B6.8]
-// WARNINGS: 10: [B6.9] (CXXConstructExpr, class A)
-// ANALYZER: 10: [B6.9] (CXXConstructExpr, [B6.11], [B6.14], [B6.15], class A)
+// WARNINGS: 10: [B6.9] (CXXConstructExpr, A)
+// ANALYZER: 10: [B6.9] (CXXConstructExpr, [B6.11], [B6.14], [B6.15], A)
// CHECK: 11: [B6.10] (BindTemporary)
-// CHECK: 12: A([B6.11]) (CXXFunctionalCastExpr, ConstructorConversion, class A)
-// CHECK: 13: [B6.12] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 12: A([B6.11]) (CXXFunctionalCastExpr, ConstructorConversion, A)
+// CHECK: 13: [B6.12] (ImplicitCastExpr, NoOp, const A)
// CHECK: 14: [B6.13]
-// WARNINGS: 15: [B6.14] (CXXConstructExpr, class A)
-// ANALYZER: 15: [B6.14] (CXXConstructExpr, [B6.16], [B4.3], class A)
+// WARNINGS: 15: [B6.14] (CXXConstructExpr, A)
+// ANALYZER: 15: [B6.14] (CXXConstructExpr, [B6.16], [B4.3], A)
// CHECK: 16: [B6.15] (BindTemporary)
// CHECK: Preds (1): B7
// CHECK: Succs (1): B4
// CHECK: [B7]
// CHECK: 1: ~B() (Temporary object destructor)
// CHECK: 2: foo
-// CHECK: 3: [B7.2] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const class A &))
-// WARNINGS: 4: B() (CXXConstructExpr, class B)
-// ANALYZER: 4: B() (CXXConstructExpr, [B7.5], [B7.6], class B)
+// CHECK: 3: [B7.2] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const A &))
+// WARNINGS: 4: B() (CXXConstructExpr, B)
+// ANALYZER: 4: B() (CXXConstructExpr, [B7.5], [B7.6], B)
// CHECK: 5: [B7.4] (BindTemporary)
// CHECK: 6: [B7.5]
// CHECK: 7: [B7.6].operator bool
// CHECK: Succs (1): B7
// CHECK: [B10]
// CHECK: 1: [B13.6] ? [B11.6] : [B12.16]
-// CHECK: 2: [B10.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 2: [B10.1] (ImplicitCastExpr, NoOp, const A)
// CHECK: 3: [B10.2]
// CHECK: 4: const A &a = B() ? A() : A(B());
// CHECK: T: (Temp Dtor) [B12.2]
// CHECK: Preds (2): B11 B12
// CHECK: Succs (2): B9 B8
// CHECK: [B11]
-// WARNINGS: 1: A() (CXXConstructExpr, class A)
-// ANALYZER: 1: A() (CXXConstructExpr, [B11.2], [B11.4], [B11.5], class A)
+// WARNINGS: 1: A() (CXXConstructExpr, A)
+// ANALYZER: 1: A() (CXXConstructExpr, [B11.2], [B11.4], [B11.5], A)
// CHECK: 2: [B11.1] (BindTemporary)
-// CHECK: 3: [B11.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 3: [B11.2] (ImplicitCastExpr, NoOp, const A)
// CHECK: 4: [B11.3]
-// WARNINGS: 5: [B11.4] (CXXConstructExpr, class A)
-// ANALYZER: 5: [B11.4] (CXXConstructExpr, [B10.3], class A)
+// WARNINGS: 5: [B11.4] (CXXConstructExpr, A)
+// ANALYZER: 5: [B11.4] (CXXConstructExpr, [B10.3], A)
// CHECK: 6: [B11.5] (BindTemporary)
// CHECK: Preds (1): B13
// CHECK: Succs (1): B10
// CHECK: [B12]
-// WARNINGS: 1: B() (CXXConstructExpr, class B)
-// ANALYZER: 1: B() (CXXConstructExpr, [B12.2], [B12.3], class B)
+// WARNINGS: 1: B() (CXXConstructExpr, B)
+// ANALYZER: 1: B() (CXXConstructExpr, [B12.2], [B12.3], B)
// CHECK: 2: [B12.1] (BindTemporary)
// CHECK: 3: [B12.2]
// CHECK: 4: [B12.3].operator A
// CHECK: 5: [B12.3]
-// CHECK: 6: [B12.5] (ImplicitCastExpr, UserDefinedConversion, class A)
+// CHECK: 6: [B12.5] (ImplicitCastExpr, UserDefinedConversion, A)
// CHECK: 7: [B12.6] (BindTemporary)
-// CHECK: 8: [B12.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 8: [B12.7] (ImplicitCastExpr, NoOp, const A)
// CHECK: 9: [B12.8]
-// WARNINGS: 10: [B12.9] (CXXConstructExpr, class A)
-// ANALYZER: 10: [B12.9] (CXXConstructExpr, [B12.11], [B12.14], [B12.15], class A)
+// WARNINGS: 10: [B12.9] (CXXConstructExpr, A)
+// ANALYZER: 10: [B12.9] (CXXConstructExpr, [B12.11], [B12.14], [B12.15], A)
// CHECK: 11: [B12.10] (BindTemporary)
-// CHECK: 12: A([B12.11]) (CXXFunctionalCastExpr, ConstructorConversion, class A)
-// CHECK: 13: [B12.12] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 12: A([B12.11]) (CXXFunctionalCastExpr, ConstructorConversion, A)
+// CHECK: 13: [B12.12] (ImplicitCastExpr, NoOp, const A)
// CHECK: 14: [B12.13]
-// WARNINGS: 15: [B12.14] (CXXConstructExpr, class A)
-// ANALYZER: 15: [B12.14] (CXXConstructExpr, [B10.3], class A)
+// WARNINGS: 15: [B12.14] (CXXConstructExpr, A)
+// ANALYZER: 15: [B12.14] (CXXConstructExpr, [B10.3], A)
// CHECK: 16: [B12.15] (BindTemporary)
// CHECK: Preds (1): B13
// CHECK: Succs (1): B10
// CHECK: [B13]
-// WARNINGS: 1: B() (CXXConstructExpr, class B)
-// ANALYZER: 1: B() (CXXConstructExpr, [B13.2], [B13.3], class B)
+// WARNINGS: 1: B() (CXXConstructExpr, B)
+// ANALYZER: 1: B() (CXXConstructExpr, [B13.2], [B13.3], B)
// CHECK: 2: [B13.1] (BindTemporary)
// CHECK: 3: [B13.2]
// CHECK: 4: [B13.3].operator bool
// CHECK: [B4]
// CXX98: 1: [B7.2] ?: [B6.6]
// CXX11: 1: [B7.3] ?: [B6.6]
-// CHECK: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 2: [B4.1] (ImplicitCastExpr, NoOp, const A)
// CHECK: 3: [B4.2]
-// WARNINGS: 4: [B4.3] (CXXConstructExpr, class A)
-// ANALYZER: 4: [B4.3] (CXXConstructExpr, [B4.5], class A)
+// WARNINGS: 4: [B4.3] (CXXConstructExpr, A)
+// ANALYZER: 4: [B4.3] (CXXConstructExpr, [B4.5], A)
// CHECK: 5: A a = A() ?: A();
// CHECK: T: (Temp Dtor) [B6.2]
// CHECK: Preds (2): B5 B6
// CHECK: Succs (2): B3 B2
// CHECK: [B5]
-// CXX98: 1: [B7.2] (ImplicitCastExpr, NoOp, const class A)
+// CXX98: 1: [B7.2] (ImplicitCastExpr, NoOp, const A)
// CXX98: 2: [B5.1]
-// WARNINGS-CXX98: 3: [B5.2] (CXXConstructExpr, class A)
-// ANALYZER-CXX98: 3: [B5.2] (CXXConstructExpr, [B5.4], class A)
+// WARNINGS-CXX98: 3: [B5.2] (CXXConstructExpr, A)
+// ANALYZER-CXX98: 3: [B5.2] (CXXConstructExpr, [B5.4], A)
// CXX98: 4: [B5.3] (BindTemporary)
-// CXX11: 1: [B7.3] (ImplicitCastExpr, NoOp, const class A)
-// WARNINGS-CXX11: 2: [B5.1] (CXXConstructExpr, class A)
-// ANALYZER-CXX11: 2: [B5.1] (CXXConstructExpr, [B5.3], class A)
+// CXX11: 1: [B7.3] (ImplicitCastExpr, NoOp, const A)
+// WARNINGS-CXX11: 2: [B5.1] (CXXConstructExpr, A)
+// ANALYZER-CXX11: 2: [B5.1] (CXXConstructExpr, [B5.3], A)
// CXX11: 3: [B5.2] (BindTemporary)
// CHECK: Preds (1): B7
// CHECK: Succs (1): B4
// CHECK: [B6]
-// WARNINGS: 1: A() (CXXConstructExpr, class A)
-// ANALYZER: 1: A() (CXXConstructExpr, [B6.2], [B6.4], [B6.5], class A)
+// WARNINGS: 1: A() (CXXConstructExpr, A)
+// ANALYZER: 1: A() (CXXConstructExpr, [B6.2], [B6.4], [B6.5], A)
// CHECK: 2: [B6.1] (BindTemporary)
-// CHECK: 3: [B6.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 3: [B6.2] (ImplicitCastExpr, NoOp, const A)
// CHECK: 4: [B6.3]
-// WARNINGS: 5: [B6.4] (CXXConstructExpr, class A)
-// ANALYZER: 5: [B6.4] (CXXConstructExpr, [B6.6], class A)
+// WARNINGS: 5: [B6.4] (CXXConstructExpr, A)
+// ANALYZER: 5: [B6.4] (CXXConstructExpr, [B6.6], A)
// CHECK: 6: [B6.5] (BindTemporary)
// CHECK: Preds (1): B7
// CHECK: Succs (1): B4
// CHECK: [B7]
-// WARNINGS: 1: A() (CXXConstructExpr, class A)
-// ANALYZER-CXX98: 1: A() (CXXConstructExpr, [B7.2], [B7.3], class A)
-// ANALYZER-CXX11: 1: A() (CXXConstructExpr, [B7.2], class A)
+// WARNINGS: 1: A() (CXXConstructExpr, A)
+// ANALYZER-CXX98: 1: A() (CXXConstructExpr, [B7.2], [B7.3], A)
+// ANALYZER-CXX11: 1: A() (CXXConstructExpr, [B7.2], A)
// CHECK: 2: [B7.1] (BindTemporary)
// CHECK: 3: [B7.2]
// CHECK: 4: [B7.3].operator bool
// CHECK: [B4]
// CXX98: 1: [B7.4] ?: [B6.6]
// CXX11: 1: [B7.5] ?: [B6.6]
-// CHECK: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 2: [B4.1] (ImplicitCastExpr, NoOp, const A)
// CHECK: 3: [B4.2]
// CHECK: 4: [B7.2]([B4.3])
// CHECK: T: (Temp Dtor) [B6.2]
// CHECK: Preds (2): B5 B6
// CHECK: Succs (2): B3 B2
// CHECK: [B5]
-// CXX98: 1: [B7.4] (ImplicitCastExpr, NoOp, const class A)
+// CXX98: 1: [B7.4] (ImplicitCastExpr, NoOp, const A)
// CXX98: 2: [B5.1]
-// WARNINGS-CXX98: 3: [B5.2] (CXXConstructExpr, class A)
-// ANALYZER-CXX98: 3: [B5.2] (CXXConstructExpr, [B5.4], class A)
+// WARNINGS-CXX98: 3: [B5.2] (CXXConstructExpr, A)
+// ANALYZER-CXX98: 3: [B5.2] (CXXConstructExpr, [B5.4], A)
// CXX98: 4: [B5.3] (BindTemporary)
-// CXX11: 1: [B7.5] (ImplicitCastExpr, NoOp, const class A)
-// WARNINGS-CXX11: 2: [B5.1] (CXXConstructExpr, class A)
-// ANALYZER-CXX11: 2: [B5.1] (CXXConstructExpr, [B5.3], class A)
+// CXX11: 1: [B7.5] (ImplicitCastExpr, NoOp, const A)
+// WARNINGS-CXX11: 2: [B5.1] (CXXConstructExpr, A)
+// ANALYZER-CXX11: 2: [B5.1] (CXXConstructExpr, [B5.3], A)
// CXX11: 3: [B5.2] (BindTemporary)
// CHECK: Preds (1): B7
// CHECK: Succs (1): B4
// CHECK: [B6]
-// WARNINGS: 1: A() (CXXConstructExpr, class A)
-// ANALYZER: 1: A() (CXXConstructExpr, [B6.2], [B6.4], [B6.5], class A)
+// WARNINGS: 1: A() (CXXConstructExpr, A)
+// ANALYZER: 1: A() (CXXConstructExpr, [B6.2], [B6.4], [B6.5], A)
// CHECK: 2: [B6.1] (BindTemporary)
-// CHECK: 3: [B6.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 3: [B6.2] (ImplicitCastExpr, NoOp, const A)
// CHECK: 4: [B6.3]
-// WARNINGS: 5: [B6.4] (CXXConstructExpr, class A)
-// ANALYZER: 5: [B6.4] (CXXConstructExpr, [B6.6], class A)
+// WARNINGS: 5: [B6.4] (CXXConstructExpr, A)
+// ANALYZER: 5: [B6.4] (CXXConstructExpr, [B6.6], A)
// CHECK: 6: [B6.5] (BindTemporary)
// CHECK: Preds (1): B7
// CHECK: Succs (1): B4
// CHECK: [B7]
// CHECK: 1: foo
-// CHECK: 2: [B7.1] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const class A &))
-// WARNINGS: 3: A() (CXXConstructExpr, class A)
-// ANALYZER-CXX98: 3: A() (CXXConstructExpr, [B7.4], class A)
-// ANALYZER-CXX11: 3: A() (CXXConstructExpr, class A)
+// CHECK: 2: [B7.1] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const A &))
+// WARNINGS: 3: A() (CXXConstructExpr, A)
+// ANALYZER-CXX98: 3: A() (CXXConstructExpr, [B7.4], A)
+// ANALYZER-CXX11: 3: A() (CXXConstructExpr, A)
// CHECK: 4: [B7.3] (BindTemporary)
// CHECK: 5: [B7.4]
// CHECK: 6: [B7.5].operator bool
// CHECK: [B9]
// CXX98: 1: [B12.2] ?: [B11.6]
// CXX11: 1: [B12.3] ?: [B11.6]
-// CHECK: 2: [B9.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 2: [B9.1] (ImplicitCastExpr, NoOp, const A)
// CHECK: 3: [B9.2]
// CHECK: 4: const A &a = A() ?: A();
// CHECK: T: (Temp Dtor) [B11.2]
// CHECK: Preds (2): B10 B11
// CHECK: Succs (2): B8 B7
// CHECK: [B10]
-// CXX98: 1: [B12.2] (ImplicitCastExpr, NoOp, const class A)
+// CXX98: 1: [B12.2] (ImplicitCastExpr, NoOp, const A)
// CXX98: 2: [B10.1]
-// WARNINGS-CXX98: 3: [B10.2] (CXXConstructExpr, class A)
-// ANALYZER-CXX98: 3: [B10.2] (CXXConstructExpr, [B10.4], class A)
+// WARNINGS-CXX98: 3: [B10.2] (CXXConstructExpr, A)
+// ANALYZER-CXX98: 3: [B10.2] (CXXConstructExpr, [B10.4], A)
// CXX98: 4: [B10.3] (BindTemporary)
-// CXX11: 1: [B12.3] (ImplicitCastExpr, NoOp, const class A)
-// WARNINGS-CXX11: 2: [B10.1] (CXXConstructExpr, class A)
-// ANALYZER-CXX11: 2: [B10.1] (CXXConstructExpr, [B10.3], class A)
+// CXX11: 1: [B12.3] (ImplicitCastExpr, NoOp, const A)
+// WARNINGS-CXX11: 2: [B10.1] (CXXConstructExpr, A)
+// ANALYZER-CXX11: 2: [B10.1] (CXXConstructExpr, [B10.3], A)
// CXX11: 3: [B10.2] (BindTemporary)
// CHECK: Preds (1): B12
// CHECK: Succs (1): B9
// CHECK: [B11]
-// WARNINGS-CHECK: 1: A() (CXXConstructExpr, class A)
-// ANALYZER-CHECK: 1: A() (CXXConstructExpr, [B11.2], class A)
+// WARNINGS-CHECK: 1: A() (CXXConstructExpr, A)
+// ANALYZER-CHECK: 1: A() (CXXConstructExpr, [B11.2], A)
// CHECK: 2: [B11.1] (BindTemporary)
-// CHECK: 3: [B11.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 3: [B11.2] (ImplicitCastExpr, NoOp, const A)
// CHECK: 4: [B11.3]
-// WARNINGS: 5: [B11.4] (CXXConstructExpr, class A)
-// ANALYZER: 5: [B11.4] (CXXConstructExpr, [B11.6], class A)
+// WARNINGS: 5: [B11.4] (CXXConstructExpr, A)
+// ANALYZER: 5: [B11.4] (CXXConstructExpr, [B11.6], A)
// CHECK: 6: [B11.5] (BindTemporary)
// CHECK: Preds (1): B12
// CHECK: Succs (1): B9
// CHECK: [B12]
-// WARNINGS: 1: A() (CXXConstructExpr, class A)
-// ANALYZER-CXX98: 1: A() (CXXConstructExpr, [B12.2], [B12.3], class A)
-// ANALYZER-CXX11: 1: A() (CXXConstructExpr, [B12.2], class A)
+// WARNINGS: 1: A() (CXXConstructExpr, A)
+// ANALYZER-CXX98: 1: A() (CXXConstructExpr, [B12.2], [B12.3], A)
+// ANALYZER-CXX11: 1: A() (CXXConstructExpr, [B12.2], A)
// CHECK: 2: [B12.1] (BindTemporary)
// CHECK: 3: [B12.2]
// CHECK: 4: [B12.3].operator bool
// CHECK: [B2 (ENTRY)]
// CHECK: Succs (1): B1
// CHECK: [B1]
-// WARNINGS: 1: A() (CXXConstructExpr, class A)
-// ANALYZER: 1: A() (CXXConstructExpr, [B1.2], [B1.4], [B1.5], class A)
+// WARNINGS: 1: A() (CXXConstructExpr, A)
+// ANALYZER: 1: A() (CXXConstructExpr, [B1.2], [B1.4], [B1.5], A)
// CHECK: 2: [B1.1] (BindTemporary)
-// CHECK: 3: [B1.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 3: [B1.2] (ImplicitCastExpr, NoOp, const A)
// CHECK: 4: [B1.3]
-// WARNINGS: 5: [B1.4] (CXXConstructExpr, class A)
-// ANALYZER: 5: [B1.4] (CXXConstructExpr, [B1.6], class A)
+// WARNINGS: 5: [B1.4] (CXXConstructExpr, A)
+// ANALYZER: 5: [B1.4] (CXXConstructExpr, [B1.6], A)
// CHECK: 6: A a = A();
// CHECK: 7: ~A() (Temporary object destructor)
// CHECK: 8: int b;
// CHECK: [B2 (ENTRY)]
// CHECK: Succs (1): B1
// CHECK: [B1]
-// WARNINGS: 1: A() (CXXConstructExpr, class A)
-// ANALYZER: 1: A() (CXXConstructExpr, [B1.4], class A)
+// WARNINGS: 1: A() (CXXConstructExpr, A)
+// ANALYZER: 1: A() (CXXConstructExpr, [B1.4], A)
// CHECK: 2: [B1.1] (BindTemporary)
-// CHECK: 3: [B1.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 3: [B1.2] (ImplicitCastExpr, NoOp, const A)
// CHECK: 4: [B1.3]
// CHECK: 5: const A &a = A();
// CHECK: 6: foo
-// CHECK: 7: [B1.6] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const class A &))
-// WARNINGS: 8: A() (CXXConstructExpr, class A)
-// ANALYZER: 8: A() (CXXConstructExpr, [B1.9], [B1.11], class A)
+// CHECK: 7: [B1.6] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const A &))
+// WARNINGS: 8: A() (CXXConstructExpr, A)
+// ANALYZER: 8: A() (CXXConstructExpr, [B1.9], [B1.11], A)
// CHECK: 9: [B1.8] (BindTemporary)
-// CHECK: 10: [B1.9] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 10: [B1.9] (ImplicitCastExpr, NoOp, const A)
// CHECK: 11: [B1.10]
// CHECK: 12: [B1.7]([B1.11])
// CHECK: 13: ~A() (Temporary object destructor)
// CHECK: Succs (1): B1
// CHECK: [B1]
// CHECK: 1: A::make
-// CHECK: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class A (*)(void))
+// CHECK: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, A (*)(void))
// WARNINGS: 3: [B1.2]()
// ANALYZER: 3: [B1.2]() (CXXRecordTypedCall, [B1.4], [B1.6], [B1.7])
// CHECK: 4: [B1.3] (BindTemporary)
-// CHECK: 5: [B1.4] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 5: [B1.4] (ImplicitCastExpr, NoOp, const A)
// CHECK: 6: [B1.5]
-// WARNINGS: 7: [B1.6] (CXXConstructExpr, class A)
-// ANALYZER: 7: [B1.6] (CXXConstructExpr, [B1.8], class A)
+// WARNINGS: 7: [B1.6] (CXXConstructExpr, A)
+// ANALYZER: 7: [B1.6] (CXXConstructExpr, [B1.8], A)
// CHECK: 8: A a = A::make();
// CHECK: 9: ~A() (Temporary object destructor)
// CHECK: 10: int b;
// CHECK: Succs (1): B1
// CHECK: [B1]
// CHECK: 1: A::make
-// CHECK: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class A (*)(void))
+// CHECK: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, A (*)(void))
// WARNINGS: 3: [B1.2]()
// ANALYZER: 3: [B1.2]() (CXXRecordTypedCall, [B1.6])
// CHECK: 4: [B1.3] (BindTemporary)
-// CHECK: 5: [B1.4] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 5: [B1.4] (ImplicitCastExpr, NoOp, const A)
// CHECK: 6: [B1.5]
// CHECK: 7: const A &a = A::make();
// CHECK: 8: foo
-// CHECK: 9: [B1.8] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const class A &))
+// CHECK: 9: [B1.8] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const A &))
// CHECK: 10: A::make
-// CHECK: 11: [B1.10] (ImplicitCastExpr, FunctionToPointerDecay, class A (*)(void))
+// CHECK: 11: [B1.10] (ImplicitCastExpr, FunctionToPointerDecay, A (*)(void))
// WARNINGS: 12: [B1.11]()
// ANALYZER: 12: [B1.11]() (CXXRecordTypedCall, [B1.13], [B1.15])
// CHECK: 13: [B1.12] (BindTemporary)
-// CHECK: 14: [B1.13] (ImplicitCastExpr, NoOp, const class A)
+// CHECK: 14: [B1.13] (ImplicitCastExpr, NoOp, const A)
// CHECK: 15: [B1.14]
// CHECK: 16: [B1.9]([B1.15])
// CHECK: 17: ~A() (Temporary object destructor)
// CHECK: Succs (1): B1
// CHECK: [B1]
// CHECK: 1: int a;
-// WARNINGS: 2: A() (CXXConstructExpr, class A)
-// ANALYZER: 2: A() (CXXConstructExpr, [B1.3], [B1.4], class A)
+// WARNINGS: 2: A() (CXXConstructExpr, A)
+// ANALYZER: 2: A() (CXXConstructExpr, [B1.3], [B1.4], A)
// CHECK: 3: [B1.2] (BindTemporary)
// CHECK: 4: [B1.3]
// CHECK: 5: [B1.4].operator int
// CHECK: [B2 (ENTRY)]
// CHECK: Succs (1): B1
// CHECK: [B1]
-// WARNINGS: 1: A() (CXXConstructExpr, class A)
-// ANALYZER: 1: A() (CXXConstructExpr, [B1.2], [B1.3], class A)
+// WARNINGS: 1: A() (CXXConstructExpr, A)
+// ANALYZER: 1: A() (CXXConstructExpr, [B1.2], [B1.3], A)
// CHECK: 2: [B1.1] (BindTemporary)
// CHECK: 3: [B1.2]
// CHECK: 4: [B1.3].operator int
// CHECK: 5: [B1.3]
// CHECK: 6: [B1.5] (ImplicitCastExpr, UserDefinedConversion, int)
// CHECK: 7: int([B1.6]) (CXXFunctionalCastExpr, NoOp, int)
-// WARNINGS: 8: B() (CXXConstructExpr, class B)
-// ANALYZER: 8: B() (CXXConstructExpr, [B1.9], [B1.10], class B)
+// WARNINGS: 8: B() (CXXConstructExpr, B)
+// ANALYZER: 8: B() (CXXConstructExpr, [B1.9], [B1.10], B)
// CHECK: 9: [B1.8] (BindTemporary)
// CHECK: 10: [B1.9]
// CHECK: 11: [B1.10].operator int
// CHECK: Succs (1): B0
// CHECK: [B2 (NORETURN)]
// CHECK: 1: int a;
-// WARNINGS: 2: NoReturn() (CXXConstructExpr, class NoReturn)
-// ANALYZER-CXX98: 2: NoReturn() (CXXConstructExpr, [B2.3], [B2.4], class NoReturn)
-// ANALYZER-CXX11: 2: NoReturn() (CXXConstructExpr, [B2.3], class NoReturn)
+// WARNINGS: 2: NoReturn() (CXXConstructExpr, NoReturn)
+// ANALYZER-CXX98: 2: NoReturn() (CXXConstructExpr, [B2.3], [B2.4], NoReturn)
+// ANALYZER-CXX11: 2: NoReturn() (CXXConstructExpr, [B2.3], NoReturn)
// CHECK: 3: [B2.2] (BindTemporary)
// CHECK: [[MEMBER:[45]]]: [B2.{{[34]}}].f
// CHECK: {{[56]}}: [B2.[[MEMBER]]]()
// CHECK: Succs (1): B0
// CHECK: [B2 (NORETURN)]
// CHECK: 1: int a;
-// WARNINGS: 2: NoReturn() (CXXConstructExpr, class NoReturn)
-// ANALYZER: 2: NoReturn() (CXXConstructExpr, [B2.3], class NoReturn)
+// WARNINGS: 2: NoReturn() (CXXConstructExpr, NoReturn)
+// ANALYZER: 2: NoReturn() (CXXConstructExpr, [B2.3], NoReturn)
// CHECK: 3: [B2.2] (BindTemporary)
// CHECK: 4: 47
// CHECK: 5: ... , [B2.4]
// CHECK: Succs (2): B4 B3
// CHECK: [B6]
// CHECK: 1: check
-// CHECK: 2: [B6.1] (ImplicitCastExpr, FunctionToPointerDecay, _Bool (*)(const class NoReturn &))
-// WARNINGS: 3: NoReturn() (CXXConstructExpr, class NoReturn)
-// ANALYZER: 3: NoReturn() (CXXConstructExpr, [B6.4], [B6.6], class NoReturn)
+// CHECK: 2: [B6.1] (ImplicitCastExpr, FunctionToPointerDecay, _Bool (*)(const NoReturn &))
+// WARNINGS: 3: NoReturn() (CXXConstructExpr, NoReturn)
+// ANALYZER: 3: NoReturn() (CXXConstructExpr, [B6.4], [B6.6], NoReturn)
// CHECK: 4: [B6.3] (BindTemporary)
-// CHECK: 5: [B6.4] (ImplicitCastExpr, NoOp, const class NoReturn)
+// CHECK: 5: [B6.4] (ImplicitCastExpr, NoOp, const NoReturn)
// CHECK: 6: [B6.5]
// CHECK: 7: [B6.2]([B6.6])
// CHECK: Preds (1): B7
// CHECK: Succs (2): B4 B3
// CHECK: [B6]
// CHECK: 1: check
-// CHECK: 2: [B6.1] (ImplicitCastExpr, FunctionToPointerDecay, _Bool (*)(const class NoReturn &))
-// WARNINGS: 3: NoReturn() (CXXConstructExpr, class NoReturn)
-// ANALYZER: 3: NoReturn() (CXXConstructExpr, [B6.4], [B6.6], class NoReturn)
+// CHECK: 2: [B6.1] (ImplicitCastExpr, FunctionToPointerDecay, _Bool (*)(const NoReturn &))
+// WARNINGS: 3: NoReturn() (CXXConstructExpr, NoReturn)
+// ANALYZER: 3: NoReturn() (CXXConstructExpr, [B6.4], [B6.6], NoReturn)
// CHECK: 4: [B6.3] (BindTemporary)
-// CHECK: 5: [B6.4] (ImplicitCastExpr, NoOp, const class NoReturn)
+// CHECK: 5: [B6.4] (ImplicitCastExpr, NoOp, const NoReturn)
// CHECK: 6: [B6.5]
// CHECK: 7: [B6.2]([B6.6])
// CHECK: Preds (1): B7
// CHECK: Succs (2): B4 B3
// CHECK: [B6]
// CHECK: 1: check
-// CHECK: 2: [B6.1] (ImplicitCastExpr, FunctionToPointerDecay, _Bool (*)(const class NoReturn &))
-// WARNINGS: 3: NoReturn() (CXXConstructExpr, class NoReturn)
-// ANALYZER: 3: NoReturn() (CXXConstructExpr, [B6.4], [B6.6], class NoReturn)
+// CHECK: 2: [B6.1] (ImplicitCastExpr, FunctionToPointerDecay, _Bool (*)(const NoReturn &))
+// WARNINGS: 3: NoReturn() (CXXConstructExpr, NoReturn)
+// ANALYZER: 3: NoReturn() (CXXConstructExpr, [B6.4], [B6.6], NoReturn)
// CHECK: 4: [B6.3] (BindTemporary)
-// CHECK: 5: [B6.4] (ImplicitCastExpr, NoOp, const class NoReturn)
+// CHECK: 5: [B6.4] (ImplicitCastExpr, NoOp, const NoReturn)
// CHECK: 6: [B6.5]
// CHECK: 7: [B6.2]([B6.6])
// CHECK: Preds (1): B7
// CHECK: Succs (1): B1
// CHECK: [B1]
// CHECK: 1: foo1
-// CHECK: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, const class pass_references_through::C &(*)(void))
+// CHECK: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, const C &(*)(void))
// CHECK: 3: [B1.2]()
// CHECK: 4: return [B1.3];
// CHECK: Preds (1): B2
// CHECK: Succs (1): B1
// CHECK: [B1]
// CHECK: 1: foo2
-// CHECK: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class pass_references_through::C &&(*)(void))
+// CHECK: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, C &&(*)(void))
// CHECK: 3: [B1.2]()
// CHECK: 4: return [B1.3];
// CHECK: Preds (1): B2
// avoid accepting and printing out a typo correction that proves to be
// incorrect once argument-dependent lookup resolution has occurred.
func(B::B()); // expected-error {{use of undeclared identifier 'func'; did you mean 'C::func'?}} \
- // expected-error {{no viable conversion from 'B::B' to 'C::C'}}
+ // expected-error {{no viable conversion from 'B::B' to 'C'}}
func(C::C());
A::A() + A::A();
B::B() + B::B();
int i = Ints::zero;
Numbers2::f(i);
- Numbers2::g(i); // expected-error {{no viable conversion from 'int' to 'Numbers::Number'}}
+ Numbers2::g(i); // expected-error {{no viable conversion from 'int' to 'Number'}}
float f = Floats::zero;
Numbers2::f(f);
- Numbers2::g(f); // expected-error {{no viable conversion from 'float' to 'Numbers::Number'}}
+ Numbers2::g(f); // expected-error {{no viable conversion from 'float' to 'Number'}}
}
namespace inline_ns {
A A::foo; // okay
#if __cplusplus < 201103L
- class B : A { }; // expected-error {{base class 'test2::A' has private default constructor}}
+ class B : A { }; // expected-error {{base class 'A' has private default constructor}}
B b; // expected-note{{implicit default constructor}}
class C : virtual A {
C();
};
- class D : C { }; // expected-error {{inherited virtual base class 'test2::A' has private default constructor}}
+ class D : C { }; // expected-error {{inherited virtual base class 'A' has private default constructor}}
D d; // expected-note{{implicit default constructor}}
#else
- class B : A { }; // expected-note {{base class 'test2::A' has an inaccessible default constructor}}
+ class B : A { }; // expected-note {{base class 'A' has an inaccessible default constructor}}
B b; // expected-error {{call to implicitly-deleted default constructor}}
// FIXME: Do a better job of explaining how we get here from class D.
- class C : virtual A { // expected-note {{default constructor of 'D' is implicitly deleted because base class 'test2::A' has an inaccessible default constructor}}
+ class C : virtual A { // expected-note {{default constructor of 'D' is implicitly deleted because base class 'A' has an inaccessible default constructor}}
public:
C();
};
static A foo;
};
- A a; // expected-error {{variable of type 'test3::A' has private destructor}}
+ A a; // expected-error {{variable of type 'A' has private destructor}}
A A::foo;
void foo(A param) { // okay
- A local; // expected-error {{variable of type 'test3::A' has private destructor}}
+ A local; // expected-error {{variable of type 'A' has private destructor}}
}
#if __cplusplus < 201103L && !defined(_MSC_VER)
// expected-error {{inherited virtual base class 'Base<3>' has private destructor}}
Base<0>, // expected-error {{base class 'Base<0>' has private destructor}}
virtual Base<1>, // expected-error {{base class 'Base<1>' has private destructor}}
- Base2, // expected-error {{base class 'test3::Base2' has private destructor}}
+ Base2, // expected-error {{base class 'Base2' has private destructor}}
virtual Base3
{
~Derived2() {}
// expected-note 2{{implicit default constructor}}
Base<0>, // expected-error 2 {{base class 'Base<0>' has private destructor}}
virtual Base<1>, // expected-error 2 {{base class 'Base<1>' has private destructor}}
- Base2, // expected-error 2 {{base class 'test3::Base2' has private destructor}}
+ Base2, // expected-error 2 {{base class 'Base2' has private destructor}}
virtual Base3
{};
Derived3 d3; // expected-note{{implicit destructor}}} \
// expected-error {{inherited virtual base class 'Base<3>' has private destructor}}
Base<0>, // expected-error {{base class 'Base<0>' has private destructor}}
virtual Base<1>, // expected-error {{base class 'Base<1>' has private destructor}}
- Base2, // expected-error {{base class 'test3::Base2' has private destructor}}
+ Base2, // expected-error {{base class 'Base2' has private destructor}}
virtual Base3
{
~Derived2() {} // expected-note 2{{in implicit destructor}}
// expected-error 2 {{inherited virtual base class 'Base<3>' has private destructor}}
Base<0>, // expected-error 2 {{base class 'Base<0>' has private destructor}}
virtual Base<1>, // expected-error 2 {{base class 'Base<1>' has private destructor}}
- Base2, // expected-error 2 {{base class 'test3::Base2' has private destructor}}
+ Base2, // expected-error 2 {{base class 'Base2' has private destructor}}
virtual Base3
{};
Derived3 d3; // expected-note{{implicit destructor}}} expected-note {{implicit default constructor}}
// expected-error {{inherited virtual base class 'Base<3>' has private destructor}}
Base<0>, // expected-error {{base class 'Base<0>' has private destructor}}
virtual Base<1>, // expected-error {{base class 'Base<1>' has private destructor}}
- Base2, // expected-error {{base class 'test3::Base2' has private destructor}}
+ Base2, // expected-error {{base class 'Base2' has private destructor}}
virtual Base3
{
~Derived2() {}
// expected-error {{inherited virtual base class 'Base<3>' has private destructor}}
Base<0>, // expected-error {{base class 'Base<0>' has private destructor}}
virtual Base<1>, // expected-error {{base class 'Base<1>' has private destructor}}
- Base2, // expected-error {{base class 'test3::Base2' has private destructor}}
+ Base2, // expected-error {{base class 'Base2' has private destructor}}
virtual Base3
{
// expected-note@+2 {{in implicit destructor for 'test3::Base2' first required here}}
a = Test1(); // expected-error {{copy assignment operator is implicitly deleted}}
}
- class Test2 : A {}; // expected-note {{because base class 'test5::A' has an inaccessible copy assignment operator}}
+ class Test2 : A {}; // expected-note {{because base class 'A' has an inaccessible copy assignment operator}}
void test2() {
Test2 a;
a = Test2(); // expected-error {{copy assignment operator is implicitly deleted}}
};
#if __cplusplus < 201103L
- class Test1 { A a; }; // expected-error {{field of type 'test6::A' has private copy constructor}}
+ class Test1 { A a; }; // expected-error {{field of type 'A' has private copy constructor}}
void test1(const Test1 &t) {
Test1 a = t; // expected-note{{implicit copy}}
}
- class Test2 : A {}; // expected-error {{base class 'test6::A' has private copy constructor}}
+ class Test2 : A {}; // expected-error {{base class 'A' has private copy constructor}}
void test2(const Test2 &t) {
Test2 a = t; // expected-note{{implicit copy}}
}
Test1 a = t; // expected-error{{implicitly-deleted}}
}
- class Test2 : A {}; // expected-note {{base class 'test6::A' has an inaccessible copy constructor}}
+ class Test2 : A {}; // expected-note {{base class 'A' has an inaccessible copy constructor}}
void test2(const Test2 &t) {
Test2 a = t; // expected-error{{implicitly-deleted}}
}
A foo();
void test() {
- foo(); // expected-error {{temporary of type 'test14::A' has private destructor}}
+ foo(); // expected-error {{temporary of type 'A' has private destructor}}
}
class X {
};
void g() {
- const X &xr = Y1(); // expected-error{{temporary of type 'test14::X' has private destructor}}
+ const X &xr = Y1(); // expected-error{{temporary of type 'X' has private destructor}}
}
}
// PR7281
namespace test16 {
class A { ~A(); }; // expected-note 2{{declared private here}}
- void b() { throw A(); } // expected-error{{temporary of type 'test16::A' has private destructor}} \
- // expected-error{{exception object of type 'test16::A' has private destructor}}
+ void b() { throw A(); } // expected-error{{temporary of type 'A' has private destructor}} \
+ // expected-error{{exception object of type 'A' has private destructor}}
}
// rdar://problem/8146294
template<typename T> struct Dependent {
using U = typename T::type;
- bool operator==(U) const = default; // expected-error {{found 'Dependent<Bad>::U'}}
- friend bool operator==(U, U) = default; // expected-error {{found 'Dependent<Bad>::U'}}
+ bool operator==(U) const = default; // expected-error {{found 'U'}}
+ friend bool operator==(U, U) = default; // expected-error {{found 'U'}}
};
struct Good { using type = const Dependent<Good>&; };
// Note: this function is not deleted. The selected operator== is
// accessible. But the derived-to-base conversion involves an inaccessible
// base class, which we don't check for until we define the function.
- bool operator==(const Z&) const = default; // expected-error {{cannot cast 'const Access::Y' to its private base class 'const Access::X'}} expected-warning {{ambiguous}}
+ bool operator==(const Z&) const = default; // expected-error {{cannot cast 'const Y' to its private base class 'const X'}} expected-warning {{ambiguous}}
};
bool z = Z() == Z(); // expected-note {{first required here}}
}
struct B {
B();
A a;
- std::strong_ordering operator<=>(const B&) const = default; // expected-error {{call to deleted constructor of 'Preference::A'}}
+ std::strong_ordering operator<=>(const B&) const = default; // expected-error {{call to deleted constructor of 'A'}}
};
bool x = B() < B(); // expected-note {{in defaulted three-way comparison operator for 'Preference::B' first required here}}
}
A operator<=>(const A&) const; // expected-note {{selected 'operator<=>' for member 'a' declared here}}
};
struct B {
- A a; // expected-note {{return type 'DeducedNotCat::A' of three-way comparison for member 'a' is not a standard comparison category type}}
+ A a; // expected-note {{return type 'A' of three-way comparison for member 'a' is not a standard comparison category type}}
auto operator<=>(const B&) const = default; // expected-warning {{implicitly deleted}}
};
}
};
A1 test1() {
A1 a;
- return a; // expected-error {{call to deleted constructor of 'test_delete_function::A1'}}
+ return a; // expected-error {{call to deleted constructor of 'A1'}}
}
struct A2 {
};
B1 test3() {
C c;
- return c; // expected-error {{conversion function from 'test_delete_function::C' to 'test_delete_function::B1' invokes a deleted function}}
+ return c; // expected-error {{conversion function from 'C' to 'B1' invokes a deleted function}}
}
struct B2 {
B1(B1 &&) = delete; // expected-note {{'B1' has been explicitly marked deleted here}}
};
B1 test3(B1 &&b) {
- return b; // expected-error {{call to deleted constructor of 'test_implicitly_movable_rvalue_ref::B1'}}
+ return b; // expected-error {{call to deleted constructor of 'B1'}}
}
struct B2 {
try {
func();
} catch (A1 a) {
- throw a; // expected-error {{call to deleted constructor of 'test_throw_parameter::A1'}}
+ throw a; // expected-error {{call to deleted constructor of 'A1'}}
}
}
void test3(A1 a) try {
func();
} catch (...) {
- throw a; // expected-error {{call to deleted constructor of 'test_throw_parameter::A1'}}
+ throw a; // expected-error {{call to deleted constructor of 'A1'}}
}
#if __cplusplus >= 201103L
namespace PR54341 {
void test4(A1 a) {
void f(decltype((throw a, 0)));
- // expected-error@-1 {{call to deleted constructor of 'test_throw_parameter::A1'}}
+ // expected-error@-1 {{call to deleted constructor of 'A1'}}
void g(int = decltype(throw a, 0){});
- // expected-error@-1 {{call to deleted constructor of 'test_throw_parameter::A1'}}
+ // expected-error@-1 {{call to deleted constructor of 'A1'}}
}
void test5(A1 a, int = decltype(throw a, 0){}) {}
-// expected-error@-1 {{call to deleted constructor of 'test_throw_parameter::A1'}}
+// expected-error@-1 {{call to deleted constructor of 'A1'}}
} // namespace PR54341
#endif
};
C test3() {
B1 b;
- return b; // expected-error {{conversion function from 'test_non_ctor_conversion::B1' to 'test_non_ctor_conversion::C' invokes a deleted function}}
+ return b; // expected-error {{conversion function from 'B1' to 'C' invokes a deleted function}}
}
struct B2 {
// not rvalue reference
// same type
B1 b;
- return b; // cxx11_2b-error {{call to deleted constructor of 'test_ctor_param_rvalue_ref::B1'}}
+ return b; // cxx11_2b-error {{call to deleted constructor of 'B1'}}
}
class DerivedB1 : public B1 {};
B1 test_3_2() {
// rvalue reference
// not same type
DerivedB1 b;
- return b; // expected-error {{call to deleted constructor of 'test_ctor_param_rvalue_ref::B1'}}
+ return b; // expected-error {{call to deleted constructor of 'B1'}}
}
NeedValue test_3_3() {
// not rvalue reference
// not same type
DerivedB1 b;
- return b; // cxx11_2b-error {{call to deleted constructor of 'test_ctor_param_rvalue_ref::B1'}}
+ return b; // cxx11_2b-error {{call to deleted constructor of 'B1'}}
}
struct B2 {
namespace test0 {
struct A { // expected-note {{definition of 'test0::A' is not complete until the closing '}'}}
- A x; // expected-error {{field has incomplete type 'test0::A'}}
+ A x; // expected-error {{field has incomplete type 'A'}}
};
}
void (**pp)() noexcept = &p; // expected-error {{cannot initialize a variable of type 'void (**)() noexcept' with an rvalue of type 'void (**)()'}}
struct S { typedef void (*p)(); operator p(); }; // expected-note {{candidate}}
- void (*q)() noexcept = S(); // expected-error {{no viable conversion from 'std_example::S' to 'void (*)() noexcept'}}
+ void (*q)() noexcept = S(); // expected-error {{no viable conversion from 'S' to 'void (*)() noexcept'}}
}
// Can't be virtual even if there's a non-virtual path.
namespace test4 {
struct A : Base {};
- struct Derived : Base, virtual A {}; // expected-warning {{direct base 'Base' is inaccessible due to ambiguity:\n struct test4::Derived -> struct Base\n struct test4::Derived -> struct test4::A -> struct Base}}
+ struct Derived : Base, virtual A {}; // expected-warning {{direct base 'Base' is inaccessible due to ambiguity:\n struct test4::Derived -> Base\n struct test4::Derived -> A -> Base}}
void test() {
int (Derived::*d) = data_ptr; // expected-error {{ambiguous conversion from pointer to member of base class 'Base' to pointer to member of derived class 'test4::Derived':}}
int (Derived::*m)() = method_ptr; // expected-error {{ambiguous conversion from pointer to member of base class 'Base' to pointer to member of derived class 'test4::Derived':}}
struct C {
constexpr ~C() {
return;
- Nonlit nl; // cxx2a-error {{variable of non-literal type 'contents::Nonlit' cannot be defined in a constexpr function before C++2b}}
+ Nonlit nl; // cxx2a-error {{variable of non-literal type 'Nonlit' cannot be defined in a constexpr function before C++2b}}
}
};
struct D {
~A();
};
struct B : A { // expected-note {{here}}
- constexpr ~B() {} // expected-error {{destructor cannot be declared constexpr because base class 'subobject::A' does not have a constexpr destructor}}
+ constexpr ~B() {} // expected-error {{destructor cannot be declared constexpr because base class 'A' does not have a constexpr destructor}}
};
struct C {
A a; // expected-note {{here}}
};
void test() {
- auto [a1] = Struct(); // expected-error {{cannot decompose class type 'AnonymousMember::Struct' because it has an anonymous struct member}}
- auto [a2] = Union(); // expected-error {{cannot decompose class type 'AnonymousMember::Union' because it has an anonymous union member}}
+ auto [a1] = Struct(); // expected-error {{cannot decompose class type 'Struct' because it has an anonymous struct member}}
+ auto [a2] = Union(); // expected-error {{cannot decompose class type 'Union' because it has an anonymous union member}}
}
}
struct I { int i; };
struct J : I {};
- struct K : I, virtual J {}; // expected-warning {{direct base 'MultipleClasses::I' is inaccessible due to ambiguity}}
+ struct K : I, virtual J {}; // expected-warning {{direct base 'I' is inaccessible due to ambiguity}}
struct L : virtual J {};
struct M : virtual J, L {};
void test() {
auto [b] = B(); // expected-error {{cannot decompose class type 'B': both it and its base class 'A' have non-static data members}}
- auto [d] = D(); // expected-error {{cannot decompose class type 'D': its base classes 'A' and 'MultipleClasses::C' have non-static data members}}
+ auto [d] = D(); // expected-error {{cannot decompose class type 'D': its base classes 'A' and 'C' have non-static data members}}
auto [e] = E();
- auto [f] = F(); // expected-error-re {{cannot decompose members of ambiguous base class 'A' of 'F':{{.*}}struct MultipleClasses::F -> struct A{{.*}}struct MultipleClasses::F -> struct MultipleClasses::E -> struct A}}
+ auto [f] = F(); // expected-error-re {{cannot decompose members of ambiguous base class 'A' of 'F':{{.*}}struct MultipleClasses::F -> A{{.*}}struct MultipleClasses::F -> E -> A}}
auto [h] = H(); // ok, only one (virtual) base subobject even though there are two paths to it
- auto [k] = K(); // expected-error {{cannot decompose members of ambiguous base class 'MultipleClasses::I'}}
+ auto [k] = K(); // expected-error {{cannot decompose members of ambiguous base class 'I'}}
auto [m] = M(); // ok, all paths to I are through the same virtual base subobject J
same<decltype(m), int>();
auto &[x, y] = b;
}
void test_external(B b) {
- auto &[x, y] = b; // expected-error {{cannot decompose members of inaccessible base class 'p0969r0::A' of 'p0969r0::B'}}
+ auto &[x, y] = b; // expected-error {{cannot decompose members of inaccessible base class 'A' of 'p0969r0::B'}}
}
struct C {
};
void f() {
- const B b; // expected-error {{default initialization of an object of const type 'const PR13492::B' without a user-provided default constructor}}
+ const B b; // expected-error {{default initialization of an object of const type 'const B' without a user-provided default constructor}}
}
}
const S& r1 = { 1, 2, 3.0 };
const S& r2 = { "Spinach" };
- S& r3 = { 1, 2, 3 }; // expected-error {{non-const lvalue reference to type 'bullet6::S' cannot bind to an initializer list temporary}}
+ S& r3 = { 1, 2, 3 }; // expected-error {{non-const lvalue reference to type 'S' cannot bind to an initializer list temporary}}
const int& i1 = { 1 };
const int& i2 = { 1.1 }; // expected-error {{type 'double' cannot be narrowed to 'int' in initializer list}} expected-note {{silence}} expected-warning {{implicit conversion}}
const int (&iar)[2] = { 1, 2 };
void test(MoveOnly mo) {
auto &&list1 = {mo}; // expected-error {{call to implicitly-deleted copy constructor}} expected-note {{in initialization of temporary of type 'std::initializer_list}}
- MoveOnly (&&list2)[1] = {mo}; // expected-error {{call to implicitly-deleted copy constructor}} expected-note {{in initialization of temporary of type 'rdar13395022::MoveOnly[1]'}}
+ MoveOnly (&&list2)[1] = {mo}; // expected-error {{call to implicitly-deleted copy constructor}} expected-note {{in initialization of temporary of type 'MoveOnly[1]'}}
std::initializer_list<MoveOnly> &&list3 = {};
MoveOnly (&&list4)[1] = {}; // expected-error {{no matching constructor}}
// expected-note@-1 {{in implicit initialization of array element 0 with omitted initializer}}
- // expected-note@-2 {{in initialization of temporary of type 'rdar13395022::MoveOnly[1]' created to list-initialize this reference}}
+ // expected-note@-2 {{in initialization of temporary of type 'MoveOnly[1]' created to list-initialize this reference}}
}
}
const A& r = x;
int&& rri = static_cast<int&&>(i);
B&& rrb = x;
- int&& rri2 = X(); // expected-error{{no viable conversion from 'std_example_2::X' to 'int'}}
+ int&& rri2 = X(); // expected-error{{no viable conversion from 'X' to 'int'}}
const double& rcd2 = 2;
double&& rrd = 2;
namespace rdar13278115 {
struct X { };
struct Y : X { };
- X &&f0(X &x) { return x; } // expected-error{{rvalue reference to type 'rdar13278115::X' cannot bind to lvalue of type 'rdar13278115::X'}}
- X &&f1(Y &y) { return y; } // expected-error{{rvalue reference to type 'rdar13278115::X' cannot bind to lvalue of type 'rdar13278115::Y'}}
- const X &&f2(Y &y) { return y; } // expected-error{{rvalue reference to type 'const rdar13278115::X' cannot bind to lvalue of type 'rdar13278115::Y'}}
+ X &&f0(X &x) { return x; } // expected-error{{rvalue reference to type 'X' cannot bind to lvalue of type 'X'}}
+ X &&f1(Y &y) { return y; } // expected-error{{rvalue reference to type 'X' cannot bind to lvalue of type 'Y'}}
+ const X &&f2(Y &y) { return y; } // expected-error{{rvalue reference to type 'const X' cannot bind to lvalue of type 'Y'}}
}
namespace bitfields {
namespace dr7 { // dr7: yes
class A { public: ~A(); };
class B : virtual private A {}; // expected-note 2 {{declared private here}}
- class C : public B {} c; // expected-error 2 {{inherited virtual base class 'dr7::A' has private destructor}} \
+ class C : public B {} c; // expected-error 2 {{inherited virtual base class 'A' has private destructor}} \
// expected-note {{implicit default constructor for 'dr7::C' first required here}} \
// expected-note {{implicit destructor for 'dr7::C' first required here}}
class VeryDerivedC : public B, virtual public A {} vdc;
using V::z;
float &z(float);
};
- struct C : A, B, virtual V {} c; // expected-warning {{direct base 'dr39::example2::A' is inaccessible due to ambiguity:\n struct dr39::example2::C -> struct dr39::example2::A\n struct dr39::example2::C -> struct dr39::example2::B -> struct dr39::example2::A}}
+ struct C : A, B, virtual V {} c; // expected-warning {{direct base 'A' is inaccessible due to ambiguity:\n struct dr39::example2::C -> A\n struct dr39::example2::C -> B -> A}}
int &x = c.x(0); // expected-error {{found in multiple base classes}}
// FIXME: This is valid, because we find the same static data member either way.
int &y = c.y(0); // expected-error {{found in multiple base classes}}
struct C {};
struct B {
B(B&); // expected-note 0-1{{candidate}}
- B(C); // expected-note 0-1{{no known conversion from 'dr84::B' to 'dr84::C'}}
+ B(C); // expected-note 0-1{{no known conversion from 'B' to 'C'}}
operator C() const;
};
A a;
struct Incomplete; // expected-note {{forward declaration of 'dr1305::Incomplete'}}
struct Complete {};
-int incomplete = alignof(Incomplete(&)[]); // expected-error {{invalid application of 'alignof' to an incomplete type 'dr1305::Incomplete'}}
+int incomplete = alignof(Incomplete(&)[]); // expected-error {{invalid application of 'alignof' to an incomplete type 'Incomplete'}}
int complete = alignof(Complete(&)[]);
}
#endif
#if __cplusplus > 201703L
enum E1 {};
enum E2 {};
- auto c = To<E1>() <=> To<E2>(); // expected-error {{invalid operands to binary expression ('To<dr1687::E1>' and 'To<dr1687::E2>')}}
+ auto c = To<E1>() <=> To<E2>(); // expected-error {{invalid operands to binary expression ('To<E1>' and 'To<E2>')}}
#endif
}
n.dr1753::~T(); // expected-error {{'dr1753' does not refer to a type name in pseudo-destructor}}
n.dr1753::T::~T();
- n.A::~T(); // expected-error {{the type of object expression ('dr1753::T' (aka 'int')) does not match the type being destroyed ('dr1753::A') in pseudo-destructor expression}}
+ n.A::~T(); // expected-error {{the type of object expression ('T' (aka 'int')) does not match the type being destroyed ('A') in pseudo-destructor expression}}
n.A::T::~T();
n.B::~T(); // expected-error {{'B' does not refer to a type name in pseudo-destructor expression}}
struct B {};
struct A {
A(A &); // expected-note 0-1{{not viable: expects an lvalue}}
- A(const B &); // expected-note 0-1{{not viable: no known conversion from 'dr177::A' to}}
+ A(const B &); // expected-note 0-1{{not viable: no known conversion from 'A' to}}
};
B b;
A a = b;
struct D : C {};
struct E { operator D(); };
E e;
- C c = e; // expected-error {{no viable constructor copying variable of type 'dr177::D'}}
+ C c = e; // expected-error {{no viable constructor copying variable of type 'D'}}
}
namespace dr178 { // dr178: yes
B* B_ptr = &D_object;
void f() {
- D_object.~B(); // expected-error {{does not match the type 'dr244::D' of the object being destroyed}}
+ D_object.~B(); // expected-error {{does not match the type 'D' of the object being destroyed}}
D_object.B::~B();
D_object.D::~B(); // FIXME: Missing diagnostic for this.
B_ptr->~B();
C() {}
};
struct D : B {
- D() {} // expected-error {{must explicitly initialize the base class 'dr257::A'}}
+ D() {} // expected-error {{must explicitly initialize the base class 'A'}}
void f();
};
}
namespace dr295 { // dr295: 3.7
typedef int f();
- const f g; // expected-warning {{'const' qualifier on function type 'dr295::f' (aka 'int ()') has no effect}}
+ const f g; // expected-warning {{'const' qualifier on function type 'f' (aka 'int ()') has no effect}}
f &r = g;
template<typename T> struct X {
const T &f;
X<f> x = {g};
typedef int U();
- typedef const U U; // expected-warning {{'const' qualifier on function type 'dr295::U' (aka 'int ()') has no effect}}
+ typedef const U U; // expected-warning {{'const' qualifier on function type 'U' (aka 'int ()') has no effect}}
typedef int (*V)();
- typedef volatile U *V; // expected-warning {{'volatile' qualifier on function type 'dr295::U' (aka 'int ()') has no effect}}
+ typedef volatile U *V; // expected-warning {{'volatile' qualifier on function type 'U' (aka 'int ()') has no effect}}
}
namespace dr296 { // dr296: yes
B::B() {} // expected-error {{a type specifier is required}}
B::A() {} // ok
- C::~C() {} // expected-error {{destructor cannot be declared using a typedef 'dr298::C' (aka 'const dr298::A') of the class name}}
+ C::~C() {} // expected-error {{destructor cannot be declared using a typedef 'C' (aka 'const dr298::A') of the class name}}
typedef struct D E; // expected-note {{here}}
struct E {}; // expected-error {{conflicts with typedef}}
void f() {
try {
throw D();
- } catch (const A&) { // expected-note {{for type 'const dr308::A &'}}
+ } catch (const A&) { // expected-note {{for type 'const A &'}}
// unreachable
- } catch (const B&) { // expected-warning {{exception of type 'const dr308::B &' will be caught by earlier handler}}
+ } catch (const B&) { // expected-warning {{exception of type 'const B &' will be caught by earlier handler}}
// get here instead
}
}
};
void f() {
throw S();
- // expected-error@-1 {{temporary of type 'dr479::S' has private destructor}}
- // expected-error@-2 {{exception object of type 'dr479::S' has private destructor}}
+ // expected-error@-1 {{temporary of type 'S' has private destructor}}
+ // expected-error@-2 {{exception object of type 'S' has private destructor}}
#if __cplusplus < 201103L
// expected-error@-4 {{C++98 requires an accessible copy constructor}}
#endif
S s; // expected-error {{private destructor}}}
throw s;
// expected-error@-1 {{calling a private constructor}}
- // expected-error@-2 {{exception object of type 'dr479::S' has private destructor}}
+ // expected-error@-2 {{exception object of type 'S' has private destructor}}
}
void h() {
try {
g();
} catch (S s) {
// expected-error@-1 {{calling a private constructor}}
- // expected-error@-2 {{variable of type 'dr479::S' has private destructor}}
+ // expected-error@-2 {{variable of type 'S' has private destructor}}
}
}
}
template<typename T> struct A<T>::B::C : A<T> {
// FIXME: Should find member of non-dependent base class A<T>.
- M m; // expected-error {{incomplete type 'dr591::A::B::M' (aka 'void'}}
+ M m; // expected-error {{incomplete type 'M' (aka 'void'}}
};
}
A a;
};
B b1 { };
- B b2 { 1 }; // expected-error {{no viable conversion from 'int' to 'dr990::A'}}
+ B b2 { 1 }; // expected-error {{no viable conversion from 'int' to 'A'}}
B b3 { { 1 } };
struct C {
struct A {};
- void g1() noexcept(A()); // expected-error {{value of type 'noex::A' is not implicitly convertible to 'bool'}}
+ void g1() noexcept(A()); // expected-error {{value of type 'A' is not implicitly convertible to 'bool'}}
void g2(bool b) noexcept(b); // expected-error {{noexcept specifier argument is not a constant expression}} expected-note {{function parameter 'b' with unknown value}} expected-note {{here}}
}
namespace TypeId {
struct S { virtual void f(); };
constexpr S *p = 0;
- constexpr const std::type_info &ti1 = typeid(*p); // expected-error {{must be initialized by a constant expression}} cxx11-note {{typeid applied to expression of polymorphic type 'TypeId::S'}} cxx20-note {{dereferenced null pointer}}
+ constexpr const std::type_info &ti1 = typeid(*p); // expected-error {{must be initialized by a constant expression}} cxx11-note {{typeid applied to expression of polymorphic type 'S'}} cxx20-note {{dereferenced null pointer}}
struct T {} t;
constexpr const std::type_info &ti2 = typeid(t);
template<int> struct X { };
constexpr A a = 42;
X<a> x; // ok, unique conversion to int
-int ary[a]; // expected-error {{ambiguous conversion from type 'const std_example::A' to an integral or unscoped enumeration type}}
+int ary[a]; // expected-error {{ambiguous conversion from type 'const A' to an integral or unscoped enumeration type}}
}
class Y : public X { };
void capture(X &x) {
- [x]() {}(); // expected-error{{by-copy capture of value of abstract type 'rdar14468891::X'}}
+ [x]() {}(); // expected-error{{by-copy capture of value of abstract type 'X'}}
}
}
struct X; // expected-note{{forward declaration of 'rdar15560464::X'}}
void foo(const X& param) {
auto x = ([=]() {
- auto& y = param; // expected-error{{by-copy capture of variable 'param' with incomplete type 'const rdar15560464::X'}}
+ auto& y = param; // expected-error{{by-copy capture of variable 'param' with incomplete type 'const X'}}
});
}
}
namespace p0702r1 {
template<typename T> struct X { // expected-note {{candidate}}
- X(std::initializer_list<T>); // expected-note {{candidate template ignored: could not match 'std::initializer_list<T>' against 'p0702r1::Z'}}
+ X(std::initializer_list<T>); // expected-note {{candidate template ignored: could not match 'std::initializer_list<T>' against 'Z'}}
};
X xi = {0};
void test(const Y& y) {
X x(static_cast<X>(y));
X x2((X)y);
- X x3 = y; // expected-error{{no viable conversion from 'const ExplicitConv::Y' to 'ExplicitConv::X'}}
+ X x3 = y; // expected-error{{no viable conversion from 'const Y' to 'X'}}
}
}
bool cmp = x1 <=> x2; // expected-error {{selected deleted operator '<=>'}}
// expected-note@#1member 5{{candidate function has been explicitly deleted}}
- // expected-note@#1 5{{candidate function not viable: no known conversion from 'bullet4::Y' to 'X<1>' for 1st argument}}
- // expected-note@#1 5{{candidate function (with reversed parameter order) not viable: no known conversion from 'bullet4::Y' to 'X<2>' for 1st argument}}
+ // expected-note@#1 5{{candidate function not viable: no known conversion from 'Y' to 'X<1>' for 1st argument}}
+ // expected-note@#1 5{{candidate function (with reversed parameter order) not viable: no known conversion from 'Y' to 'X<2>' for 1st argument}}
bool mem_lt = y < x2; // expected-error {{selected deleted operator '<=>'}}
bool mem_le = y <= x2; // expected-error {{selected deleted operator '<=>'}}
bool mem_gt = y > x2; // expected-error {{selected deleted operator '<=>'}}
// expected-note@#1member 5{{candidate function (with reversed parameter order) has been explicitly deleted}}
// expected-note@#1 5{{candidate function not viable: no known conversion from 'X<2>' to 'X<1>' for 1st argument}}
- // expected-note@#1 5{{candidate function (with reversed parameter order) not viable: no known conversion from 'bullet4::Y' to 'X<1>' for 2nd argument}}
+ // expected-note@#1 5{{candidate function (with reversed parameter order) not viable: no known conversion from 'Y' to 'X<1>' for 2nd argument}}
bool mem_rlt = x2 < y; // expected-error {{selected deleted operator '<=>'}}
bool mem_rle = x2 <= y; // expected-error {{selected deleted operator '<=>'}}
bool mem_rgt = x2 > y; // expected-error {{selected deleted operator '<=>'}}
bool ne = x1 != x2; // expected-error {{selected deleted operator '=='}}
// expected-note@#2member 2{{candidate function has been explicitly deleted}}
- // expected-note@#2 2{{candidate function not viable: no known conversion from 'bullet4::Y' to 'X<1>' for 1st argument}}
- // expected-note@#2 2{{candidate function (with reversed parameter order) not viable: no known conversion from 'bullet4::Y' to 'X<2>' for 1st argument}}
+ // expected-note@#2 2{{candidate function not viable: no known conversion from 'Y' to 'X<1>' for 1st argument}}
+ // expected-note@#2 2{{candidate function (with reversed parameter order) not viable: no known conversion from 'Y' to 'X<2>' for 1st argument}}
bool mem_eq = y == x2; // expected-error {{selected deleted operator '=='}}
bool mem_ne = y != x2; // expected-error {{selected deleted operator '=='}}
// expected-note@#2member 2{{candidate function (with reversed parameter order) has been explicitly deleted}}
// expected-note@#2 2{{candidate function not viable: no known conversion from 'X<2>' to 'X<1>' for 1st argument}}
- // expected-note@#2 2{{candidate function (with reversed parameter order) not viable: no known conversion from 'bullet4::Y' to 'X<1>' for 2nd argument}}
+ // expected-note@#2 2{{candidate function (with reversed parameter order) not viable: no known conversion from 'Y' to 'X<1>' for 2nd argument}}
bool mem_req = x2 == y; // expected-error {{selected deleted operator '=='}}
bool mem_rne = x2 != y; // expected-error {{selected deleted operator '=='}}
struct ICUDerived : ICUBase {
UBool operator==(const ICUBase&) const override; // expected-note {{declared here}} expected-note {{ambiguity is between}}
};
- bool cmp_icu = ICUDerived() != ICUDerived(); // expected-warning {{ambiguous}} expected-warning {{'bool', not 'problem_cases::UBool'}}
+ bool cmp_icu = ICUDerived() != ICUDerived(); // expected-warning {{ambiguous}} expected-warning {{'bool', not 'UBool'}}
}
#else // NO_ERRORS
enum E {};
E operator==(Y, Z); // expected-note {{here}}
- bool h = z == y; // expected-warning {{ISO C++20 requires return type of selected 'operator==' function for rewritten '==' comparison to be 'bool', not 'not_bool::E'}}
+ bool h = z == y; // expected-warning {{ISO C++20 requires return type of selected 'operator==' function for rewritten '==' comparison to be 'bool', not 'E'}}
}
struct X { bool equal; };
};
void g() {
T t;
- t = T(); // expected-error{{object of type 'PR13381::T' cannot be assigned because its copy assignment operator is implicitly deleted}}
+ t = T(); // expected-error{{object of type 'T' cannot be assigned because its copy assignment operator is implicitly deleted}}
}
}
X x2;
if (i)
throw x2; // okay
- throw x; // expected-error{{call to deleted constructor of 'PR10142::X'}}
+ throw x; // expected-error{{call to deleted constructor of 'X'}}
} catch (...) {
}
}
};
constexpr B b0(0, 0.0f); // ok, constexpr
- B b1(0, 1); // expected-error {{call to constructor of 'DRnnnn::B' is ambiguous}}
+ B b1(0, 1); // expected-error {{call to constructor of 'B' is ambiguous}}
}
void test() {
A a;
- foo(a); // expected-error {{call to deleted constructor of 'test0::A'}}
+ foo(a); // expected-error {{call to deleted constructor of 'A'}}
}
}
for (auto *a : A()) { // expected-error {{variable 'a' with type 'auto *' has incompatible initializer of type 'int'}}
}
// : is not a typo for :: here.
- for (A NS:A()) { // expected-error {{no viable conversion from 'int' to 'X::A'}}
+ for (A NS:A()) { // expected-error {{no viable conversion from 'int' to 'A'}}
}
for (auto not_in_scope : not_in_scope) { // expected-error {{use of undeclared identifier 'not_in_scope'}}
}
namespace NS {
class ADL {};
- int *begin(ADL); // expected-note {{no known conversion from 'NS::NoADL' to 'NS::ADL'}}
+ int *begin(ADL); // expected-note {{no known conversion from 'NS::NoADL' to 'ADL'}}
int *end(ADL);
class NoADL {};
}
if constexpr (b) { // expected-error {{constexpr if condition is not a constant expression}} expected-note {{cannot be used in a constant expression}}
}
- if constexpr (s) { // expected-error {{value of type 'ccce::S' is not contextually convertible to 'bool'}}
+ if constexpr (s) { // expected-error {{value of type 'S' is not contextually convertible to 'bool'}}
}
constexpr S constexprS;
- if constexpr (constexprS) { // expected-error {{value of type 'const ccce::S' is not contextually convertible to 'bool'}}
+ if constexpr (constexprS) { // expected-error {{value of type 'const S' is not contextually convertible to 'bool'}}
}
}
}
//
// CHECK: ![[INT]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed
// CHECK: ![[INT_POINTER]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[INT]], size: 64
-// CHECK: ![[TYPEDEF_T1]] = !DIDerivedType(tag: DW_TAG_typedef, name: "__t1"
// CHECK: ![[STRUCT_T1]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "t1"
+// CHECK: ![[TYPEDEF_T1]] = !DIDerivedType(tag: DW_TAG_typedef, name: "__t1"
// CHECK: call i32 @llvm.bpf.preserve.type.info(i32 5, i64 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[ENUM_AA]]
// CHECK: ![[ENUM_AA]] = !DICompositeType(tag: DW_TAG_enumeration_type, name: "AA"
-// CHECK: ![[TYPEDEF_INT]] = !DIDerivedType(tag: DW_TAG_typedef, name: "__int"
// CHECK: ![[STRUCT_S]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s"
+// CHECK: ![[TYPEDEF_INT]] = !DIDerivedType(tag: DW_TAG_typedef, name: "__int"
struct X : D {
// CHECK-LABEL: VFTable for 'test1::D' in 'test1::X' (3 entries).
- // CHECK-NEXT: 0 | test1::C *test1::X::foo()
+ // CHECK-NEXT: 0 | C *test1::X::foo()
// CHECK-NEXT: [return adjustment (to type 'struct test1::B *'): 4 non-virtual]
// CHECK-NEXT: 1 | void test1::D::z()
- // CHECK-NEXT: 2 | test1::C *test1::X::foo()
+ // CHECK-NEXT: 2 | C *test1::X::foo()
- // CHECK-LABEL: Thunks for 'test1::C *test1::X::foo()' (1 entry).
+ // CHECK-LABEL: Thunks for 'C *test1::X::foo()' (1 entry).
// CHECK-NEXT: 0 | [return adjustment (to type 'struct test1::B *'): 4 non-virtual]
// CHECK-LABEL: VFTable indices for 'test1::X' (1 entry).
- // CHECK-NEXT: 2 | test1::C *test1::X::foo()
+ // CHECK-NEXT: 2 | C *test1::X::foo()
// MANGLING-DAG: @"??_7X@test1@@6B@"
struct X : E {
virtual F* foo();
// CHECK-LABEL: VFTable for 'test2::D' in 'test2::E' in 'test2::X' (4 entries).
- // CHECK-NEXT: 0 | test2::F *test2::X::foo()
+ // CHECK-NEXT: 0 | F *test2::X::foo()
// CHECK-NEXT: [return adjustment (to type 'struct test2::B *'): 4 non-virtual]
// CHECK-NEXT: 1 | void test2::D::z()
- // CHECK-NEXT: 2 | test2::F *test2::X::foo()
+ // CHECK-NEXT: 2 | F *test2::X::foo()
// CHECK-NEXT: [return adjustment (to type 'struct test2::C *'): 0 non-virtual]
- // CHECK-NEXT: 3 | test2::F *test2::X::foo()
+ // CHECK-NEXT: 3 | F *test2::X::foo()
- // CHECK-LABEL: Thunks for 'test2::F *test2::X::foo()' (2 entries).
+ // CHECK-LABEL: Thunks for 'F *test2::X::foo()' (2 entries).
// CHECK-NEXT: 0 | [return adjustment (to type 'struct test2::C *'): 0 non-virtual]
// CHECK-NEXT: 1 | [return adjustment (to type 'struct test2::B *'): 4 non-virtual]
// CHECK-LABEL: VFTable indices for 'test2::X' (1 entry).
- // CHECK-NEXT: 3 | test2::F *test2::X::foo()
+ // CHECK-NEXT: 3 | F *test2::X::foo()
};
void build_vftable(X *obj) { obj->foo(); }
struct X : E {
// CHECK-LABEL: VFTable for 'test3::D' in 'test3::E' in 'test3::X' (4 entries).
- // CHECK-NEXT: 0 | test3::F *test3::X::foo()
+ // CHECK-NEXT: 0 | F *test3::X::foo()
// CHECK-NEXT: [return adjustment (to type 'struct test3::B *'): 8 non-virtual]
// CHECK-NEXT: 1 | void test3::D::z()
- // CHECK-NEXT: 2 | test3::F *test3::X::foo()
+ // CHECK-NEXT: 2 | F *test3::X::foo()
// CHECK-NEXT: [return adjustment (to type 'struct test3::C *'): 4 non-virtual]
- // CHECK-NEXT: 3 | test3::F *test3::X::foo()
+ // CHECK-NEXT: 3 | F *test3::X::foo()
- // CHECK-LABEL: Thunks for 'test3::F *test3::X::foo()' (2 entries).
+ // CHECK-LABEL: Thunks for 'F *test3::X::foo()' (2 entries).
// CHECK-NEXT: 0 | [return adjustment (to type 'struct test3::C *'): 4 non-virtual]
// CHECK-NEXT: 1 | [return adjustment (to type 'struct test3::B *'): 8 non-virtual]
// CHECK-LABEL: VFTable indices for 'test3::X' (1 entry).
- // CHECK-NEXT: 3 | test3::F *test3::X::foo()
+ // CHECK-NEXT: 3 | F *test3::X::foo()
virtual F* foo();
};
struct X : D, E {
// CHECK-LABEL: VFTable for 'test4::D' in 'test4::X' (3 entries).
- // CHECK-NEXT: 0 | test4::F *test4::X::foo()
+ // CHECK-NEXT: 0 | F *test4::X::foo()
// CHECK-NEXT: [return adjustment (to type 'struct test4::B *'): 8 non-virtual]
// CHECK-NEXT: 1 | void test4::D::z()
- // CHECK-NEXT: 2 | test4::F *test4::X::foo()
+ // CHECK-NEXT: 2 | F *test4::X::foo()
- // CHECK-LABEL: Thunks for 'test4::F *test4::X::foo()' (1 entry).
+ // CHECK-LABEL: Thunks for 'F *test4::X::foo()' (1 entry).
// CHECK-NEXT: 0 | [return adjustment (to type 'struct test4::B *'): 8 non-virtual]
// CHECK-LABEL: VFTable for 'test4::D' in 'test4::E' in 'test4::X' (4 entries).
- // CHECK-NEXT: 0 | test4::F *test4::X::foo()
+ // CHECK-NEXT: 0 | F *test4::X::foo()
// CHECK-NEXT: [return adjustment (to type 'struct test4::B *'): 8 non-virtual]
// CHECK-NEXT: [this adjustment: -4 non-virtual]
// CHECK-NEXT: 1 | void test4::D::z()
- // CHECK-NEXT: 2 | test4::F *test4::X::foo()
+ // CHECK-NEXT: 2 | F *test4::X::foo()
// CHECK-NEXT: [return adjustment (to type 'struct test4::C *'): 4 non-virtual]
// CHECK-NEXT: [this adjustment: -4 non-virtual]
- // CHECK-NEXT: 3 | test4::F *test4::X::foo()
+ // CHECK-NEXT: 3 | F *test4::X::foo()
// CHECK-NEXT: [return adjustment (to type 'struct test4::F *'): 0 non-virtual]
// CHECK-NEXT: [this adjustment: -4 non-virtual]
- // CHECK-LABEL: Thunks for 'test4::F *test4::X::foo()' (3 entries).
+ // CHECK-LABEL: Thunks for 'F *test4::X::foo()' (3 entries).
// CHECK-NEXT: 0 | [return adjustment (to type 'struct test4::F *'): 0 non-virtual]
// CHECK-NEXT: [this adjustment: -4 non-virtual]
// CHECK-NEXT: 1 | [return adjustment (to type 'struct test4::C *'): 4 non-virtual]
// CHECK-NEXT: [this adjustment: -4 non-virtual]
// CHECK-LABEL: VFTable indices for 'test4::X' (1 entry).
- // CHECK-NEXT: 2 | test4::F *test4::X::foo()
+ // CHECK-NEXT: 2 | F *test4::X::foo()
virtual F* foo();
};
// CHECK-NEXT: 1 | void test5::A::h()
// CHECK-LABEL: VFTable for 'test5::D' in 'test5::X' (3 entries).
- // CHECK-NEXT: 0 | test5::C *test5::X::foo()
+ // CHECK-NEXT: 0 | C *test5::X::foo()
// CHECK-NEXT: [return adjustment (to type 'struct test5::B *'): 4 non-virtual]
// CHECK-NEXT: 1 | void test5::D::z()
- // CHECK-NEXT: 2 | test5::C *test5::X::foo()
+ // CHECK-NEXT: 2 | C *test5::X::foo()
- // CHECK-LABEL: Thunks for 'test5::C *test5::X::foo()' (1 entry).
+ // CHECK-LABEL: Thunks for 'C *test5::X::foo()' (1 entry).
// CHECK-NEXT: 0 | [return adjustment (to type 'struct test5::B *'): 4 non-virtual]
// CHECK-LABEL: VFTable indices for 'test5::X' (1 entry).
// CHECK-NEXT: via vfptr at offset 4
- // CHECK-NEXT: 2 | test5::C *test5::X::foo()
+ // CHECK-NEXT: 2 | C *test5::X::foo()
virtual C* foo();
};
// CHECK-NEXT: 1 | void test6::A::h()
// CHECK-LABEL: VFTable for 'test6::D' in 'test6::E' in 'test6::X' (4 entries).
- // CHECK-NEXT: 0 | test6::F *test6::X::foo()
+ // CHECK-NEXT: 0 | F *test6::X::foo()
// CHECK-NEXT: [return adjustment (to type 'struct test6::B *'): 8 non-virtual]
// CHECK-NEXT: 1 | void test6::D::z()
- // CHECK-NEXT: 2 | test6::F *test6::X::foo()
+ // CHECK-NEXT: 2 | F *test6::X::foo()
// CHECK-NEXT: [return adjustment (to type 'struct test6::C *'): 4 non-virtual]
- // CHECK-NEXT: 3 | test6::F *test6::X::foo()
+ // CHECK-NEXT: 3 | F *test6::X::foo()
- // CHECK-LABEL: Thunks for 'test6::F *test6::X::foo()' (2 entries).
+ // CHECK-LABEL: Thunks for 'F *test6::X::foo()' (2 entries).
// CHECK-NEXT: 0 | [return adjustment (to type 'struct test6::C *'): 4 non-virtual]
// CHECK-NEXT: 1 | [return adjustment (to type 'struct test6::B *'): 8 non-virtual]
// CHECK-LABEL: VFTable indices for 'test6::X' (1 entry).
// CHECK-NEXT: -- accessible via vfptr at offset 4 --
- // CHECK-NEXT: 3 | test6::F *test6::X::foo()
+ // CHECK-NEXT: 3 | F *test6::X::foo()
virtual F* foo();
};
// CHECK-NEXT: 0 | void test7::C::g()
// CHECK-LABEL: VFTable for 'test7::A' in 'test7::C' (2 entries).
- // CHECK-NEXT: 0 | test7::C *test7::C::f() [pure]
- // CHECK-NEXT: 1 | test7::C *test7::C::f() [pure]
+ // CHECK-NEXT: 0 | C *test7::C::f() [pure]
+ // CHECK-NEXT: 1 | C *test7::C::f() [pure]
// No return adjusting thunks needed for pure virtual methods.
// CHECK-NOT: Thunks for 'test7::C *test7::C::f()'
struct C : A, B {
virtual C* f();
// CHECK-LABEL: VFTable for 'pr20444::A' in 'pr20444::C' (1 entry).
- // CHECK-NEXT: 0 | pr20444::C *pr20444::C::f()
+ // CHECK-NEXT: 0 | C *pr20444::C::f()
// CHECK-LABEL: VFTable for 'pr20444::B' in 'pr20444::C' (2 entries).
- // CHECK-NEXT: 0 | pr20444::C *pr20444::C::f()
+ // CHECK-NEXT: 0 | C *pr20444::C::f()
// CHECK-NEXT: [return adjustment (to type 'struct pr20444::B *'): 4 non-virtual]
// CHECK-NEXT: [this adjustment: -4 non-virtual]
- // CHECK-NEXT: 1 | pr20444::C *pr20444::C::f()
+ // CHECK-NEXT: 1 | C *pr20444::C::f()
// CHECK-NEXT: [return adjustment (to type 'struct pr20444::C *'): 0 non-virtual]
// CHECK-NEXT: [this adjustment: -4 non-virtual]
};
struct D : C {
virtual D* f();
// CHECK-LABEL: VFTable for 'pr20444::A' in 'pr20444::C' in 'pr20444::D' (1 entry).
- // CHECK-NEXT: 0 | pr20444::D *pr20444::D::f()
+ // CHECK-NEXT: 0 | D *pr20444::D::f()
// CHECK-LABEL: VFTable for 'pr20444::B' in 'pr20444::C' in 'pr20444::D' (3 entries).
- // CHECK-NEXT: 0 | pr20444::D *pr20444::D::f()
+ // CHECK-NEXT: 0 | D *pr20444::D::f()
// CHECK-NEXT: [return adjustment (to type 'struct pr20444::B *'): 4 non-virtual]
// CHECK-NEXT: [this adjustment: -4 non-virtual]
- // CHECK-NEXT: 1 | pr20444::D *pr20444::D::f()
+ // CHECK-NEXT: 1 | D *pr20444::D::f()
// CHECK-NEXT: [return adjustment (to type 'struct pr20444::C *'): 0 non-virtual]
// CHECK-NEXT: [this adjustment: -4 non-virtual]
- // CHECK-NEXT: 2 | pr20444::D *pr20444::D::f()
+ // CHECK-NEXT: 2 | D *pr20444::D::f()
// CHECK-NEXT: [return adjustment (to type 'struct pr20444::D *'): 0 non-virtual]
// CHECK-NEXT: [this adjustment: -4 non-virtual]
};
J::J() {}
// VFTABLES-LABEL: VFTable for 'test1::H' in 'test1::I' in 'test1::J' (3 entries).
-// VFTABLES-NEXT: 0 | test1::D *test1::J::foo()
+// VFTABLES-NEXT: 0 | D *test1::J::foo()
// VFTABLES-NEXT: [return adjustment (to type 'struct test1::B *'): 4 non-virtual]
-// VFTABLES-NEXT: 1 | test1::D *test1::J::foo()
+// VFTABLES-NEXT: 1 | D *test1::J::foo()
// VFTABLES-NEXT: [return adjustment (to type 'struct test1::C *'): 0 non-virtual]
-// VFTABLES-NEXT: 2 | test1::D *test1::J::foo()
+// VFTABLES-NEXT: 2 | D *test1::J::foo()
// GLOBALS-LABEL: @"??_7J@test1@@6B@" = linkonce_odr unnamed_addr constant { [3 x i8*] }
// GLOBALS: @"?foo@J@test1@@QAEPAUB@2@XZ"
K::K() {}
// VFTABLES-LABEL: VFTable for 'test1::H' in 'test1::I' in 'test1::J' in 'test1::K' (4 entries).
-// VFTABLES-NEXT: 0 | test1::E *test1::K::foo()
+// VFTABLES-NEXT: 0 | E *test1::K::foo()
// VFTABLES-NEXT: [return adjustment (to type 'struct test1::B *'): 4 non-virtual]
-// VFTABLES-NEXT: 1 | test1::E *test1::K::foo()
+// VFTABLES-NEXT: 1 | E *test1::K::foo()
// VFTABLES-NEXT: [return adjustment (to type 'struct test1::C *'): 0 non-virtual]
-// VFTABLES-NEXT: 2 | test1::E *test1::K::foo()
+// VFTABLES-NEXT: 2 | E *test1::K::foo()
// VFTABLES-NEXT: [return adjustment (to type 'struct test1::D *'): 0 non-virtual]
-// VFTABLES-NEXT: 3 | test1::E *test1::K::foo()
+// VFTABLES-NEXT: 3 | E *test1::K::foo()
// Only B to C requires adjustment, but we get 3 thunks in K's vftable, two of
// which are trivial.
J::J() {}
// VFTABLES-LABEL: VFTable for 'test2::H' in 'test2::I' in 'test2::J' (2 entries).
-// VFTABLES-NEXT: 0 | test2::D *test2::J::foo()
+// VFTABLES-NEXT: 0 | D *test2::J::foo()
// VFTABLES-NEXT: [return adjustment (to type 'struct test2::B *'): 4 non-virtual]
-// VFTABLES-NEXT: 1 | test2::D *test2::J::foo()
+// VFTABLES-NEXT: 1 | D *test2::J::foo()
// GLOBALS-LABEL: @"??_7J@test2@@6B@" = linkonce_odr unnamed_addr constant { [2 x i8*] }
K::K() {}
// VFTABLES-LABEL: VFTable for 'test2::H' in 'test2::I' in 'test2::J' in 'test2::K' (3 entries).
-// VFTABLES-NEXT: 0 | test2::E *test2::K::foo()
+// VFTABLES-NEXT: 0 | E *test2::K::foo()
// VFTABLES-NEXT: [return adjustment (to type 'struct test2::B *'): 4 non-virtual]
-// VFTABLES-NEXT: 1 | test2::E *test2::K::foo()
+// VFTABLES-NEXT: 1 | E *test2::K::foo()
// VFTABLES-NEXT: [return adjustment (to type 'struct test2::D *'): 0 non-virtual]
-// VFTABLES-NEXT: 2 | test2::E *test2::K::foo()
+// VFTABLES-NEXT: 2 | E *test2::K::foo()
// GLOBALS-LABEL: @"??_7K@test2@@6B@" = linkonce_odr unnamed_addr constant { [3 x i8*] }
struct C : virtual A, B {
// VFTABLES-LABEL: VFTable for 'pr20479::A' in 'pr20479::B' in 'pr20479::C' (2 entries).
-// VFTABLES-NEXT: 0 | pr20479::B *pr20479::B::f()
+// VFTABLES-NEXT: 0 | B *pr20479::B::f()
// VFTABLES-NEXT: [return adjustment (to type 'struct pr20479::A *'): vbase #1, 0 non-virtual]
-// VFTABLES-NEXT: 1 | pr20479::B *pr20479::B::f()
+// VFTABLES-NEXT: 1 | B *pr20479::B::f()
C();
};
struct C : virtual A, virtual B {
// VFTABLES-LABEL: VFTable for 'pr21073::A' in 'pr21073::B' in 'pr21073::C' (2 entries).
-// VFTABLES-NEXT: 0 | pr21073::B *pr21073::B::f()
+// VFTABLES-NEXT: 0 | B *pr21073::B::f()
// VFTABLES-NEXT: [return adjustment (to type 'struct pr21073::A *'): vbase #1, 0 non-virtual]
// VFTABLES-NEXT: [this adjustment: 8 non-virtual]
-// VFTABLES-NEXT: 1 | pr21073::B *pr21073::B::f()
+// VFTABLES-NEXT: 1 | B *pr21073::B::f()
// VFTABLES-NEXT: [return adjustment (to type 'struct pr21073::B *'): 0 non-virtual]
// VFTABLES-NEXT: [this adjustment: 8 non-virtual]
C();
D::D() {}
// VFTABLES-LABEL: VFTable for 'pr21073_2::A' in 'pr21073_2::C' in 'pr21073_2::D' (2 entries)
-// VFTABLES-NEXT: 0 | pr21073_2::C *pr21073_2::C::foo()
+// VFTABLES-NEXT: 0 | C *pr21073_2::C::foo()
// VFTABLES-NEXT: [return adjustment (to type 'struct pr21073_2::A *'): vbase #1, 0 non-virtual]
-// VFTABLES-NEXT: 1 | pr21073_2::C *pr21073_2::C::foo()
+// VFTABLES-NEXT: 1 | C *pr21073_2::C::foo()
// GLOBALS-LABEL: @"??_7D@pr21073_2@@6B@" = {{.*}} constant { [2 x i8*] }
// GLOBALS: @"?foo@C@pr21073_2@@QAEPAUA@2@XZ"
D::D() {}
// VFTABLES-LABEL: VFTable for 'test3::A' in 'test3::B' in 'test3::X' in 'test3::C' in 'test3::D' (3 entries).
-// VFTABLES-NEXT: 0 | test3::D *test3::D::fn()
+// VFTABLES-NEXT: 0 | D *test3::D::fn()
// VFTABLES-NEXT: [return adjustment (to type 'struct test3::A *'): vbase #1, 0 non-virtual]
// VFTABLES-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
-// VFTABLES-NEXT: 1 | test3::D *test3::D::fn()
+// VFTABLES-NEXT: 1 | D *test3::D::fn()
// VFTABLES-NEXT: [return adjustment (to type 'struct test3::B *'): vbase #2, 0 non-virtual]
// VFTABLES-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
-// VFTABLES-NEXT: 2 | test3::D *test3::D::fn()
+// VFTABLES-NEXT: 2 | D *test3::D::fn()
// VFTABLES-NEXT: [return adjustment (to type 'struct test3::D *'): 0 non-virtual]
// VFTABLES-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
// VFTABLES-LABEL: VFTable indices for 'pr34302::C' (2 entries).
// VFTABLES-NEXT: -- accessible via vbtable index 1, vfptr at offset 0 --
// VFTABLES-NEXT: 0 | pr34302::C::~C() [scalar deleting]
-// VFTABLES-NEXT: 2 | pr34302::C *pr34302::C::f()
+// VFTABLES-NEXT: 2 | C *pr34302::C::f()
}
struct W : Z {
// CHECK-LABEL: VFTable for 'return_adjustment::Z' in 'return_adjustment::W' (2 entries).
- // CHECK-NEXT: 0 | return_adjustment::X *return_adjustment::W::foo()
+ // CHECK-NEXT: 0 | X *return_adjustment::W::foo()
// CHECK-NEXT: [return adjustment (to type 'struct A *'): vbase #1, 0 non-virtual]
- // CHECK-NEXT: 1 | return_adjustment::X *return_adjustment::W::foo()
+ // CHECK-NEXT: 1 | X *return_adjustment::W::foo()
- // CHECK-LABEL: Thunks for 'return_adjustment::X *return_adjustment::W::foo()' (1 entry).
+ // CHECK-LABEL: Thunks for 'X *return_adjustment::W::foo()' (1 entry).
// CHECK-NEXT: 0 | [return adjustment (to type 'struct A *'): vbase #1, 0 non-virtual]
// CHECK-LABEL: VFTable indices for 'return_adjustment::W' (1 entry).
- // CHECK-NEXT: 1 | return_adjustment::X *return_adjustment::W::foo()
+ // CHECK-NEXT: 1 | X *return_adjustment::W::foo()
virtual X* foo();
};
struct T : W {
// CHECK-LABEL: VFTable for 'return_adjustment::Z' in 'return_adjustment::W' in 'return_adjustment::T' (3 entries).
- // CHECK-NEXT: 0 | return_adjustment::Y *return_adjustment::T::foo()
+ // CHECK-NEXT: 0 | Y *return_adjustment::T::foo()
// CHECK-NEXT: [return adjustment (to type 'struct A *'): vbase #1, 0 non-virtual]
- // CHECK-NEXT: 1 | return_adjustment::Y *return_adjustment::T::foo()
+ // CHECK-NEXT: 1 | Y *return_adjustment::T::foo()
// CHECK-NEXT: [return adjustment (to type 'struct return_adjustment::X *'): vbase #2, 0 non-virtual]
- // CHECK-NEXT: 2 | return_adjustment::Y *return_adjustment::T::foo()
+ // CHECK-NEXT: 2 | Y *return_adjustment::T::foo()
- // CHECK-LABEL: Thunks for 'return_adjustment::Y *return_adjustment::T::foo()' (2 entries).
+ // CHECK-LABEL: Thunks for 'Y *return_adjustment::T::foo()' (2 entries).
// CHECK-NEXT: 0 | [return adjustment (to type 'struct A *'): vbase #1, 0 non-virtual]
// CHECK-NEXT: 1 | [return adjustment (to type 'struct return_adjustment::X *'): vbase #2, 0 non-virtual]
// CHECK-LABEL: VFTable indices for 'return_adjustment::T' (1 entry).
- // CHECK-NEXT: 2 | return_adjustment::Y *return_adjustment::T::foo()
+ // CHECK-NEXT: 2 | Y *return_adjustment::T::foo()
virtual Y* foo();
};
struct V : Z {
// CHECK-LABEL: VFTable for 'return_adjustment::Z' in 'return_adjustment::V' (2 entries).
- // CHECK-NEXT: 0 | return_adjustment::U *return_adjustment::V::foo()
+ // CHECK-NEXT: 0 | U *return_adjustment::V::foo()
// CHECK-NEXT: [return adjustment (to type 'struct A *'): vbptr at offset 4, vbase #1, 0 non-virtual]
- // CHECK-NEXT: 1 | return_adjustment::U *return_adjustment::V::foo()
+ // CHECK-NEXT: 1 | U *return_adjustment::V::foo()
- // CHECK-LABEL: Thunks for 'return_adjustment::U *return_adjustment::V::foo()' (1 entry).
+ // CHECK-LABEL: Thunks for 'U *return_adjustment::V::foo()' (1 entry).
// CHECK-NEXT: 0 | [return adjustment (to type 'struct A *'): vbptr at offset 4, vbase #1, 0 non-virtual]
// CHECK-LABEL: VFTable indices for 'return_adjustment::V' (1 entry).
- // CHECK-NEXT: 1 | return_adjustment::U *return_adjustment::V::foo()
+ // CHECK-NEXT: 1 | U *return_adjustment::V::foo()
virtual U* foo();
};
// CHECK-DAG: private unnamed_addr constant [30 x i8] c"NS::Destructor::~Destructor()\00"
// CHECK-DAG: private unnamed_addr constant [12 x i8] c"Constructor\00"
-// CHECK-DAG: private unnamed_addr constant [41 x i8] c"NS::Constructor::Constructor(NS::Base *)\00"
+// CHECK-DAG: private unnamed_addr constant [37 x i8] c"NS::Constructor::Constructor(Base *)\00"
// CHECK-DAG: private unnamed_addr constant [34 x i8] c"NS::Constructor::Constructor(int)\00"
// CHECK-DAG: private unnamed_addr constant [31 x i8] c"NS::Constructor::Constructor()\00"
// CHECK-DAG: private unnamed_addr constant [37 x i8] c"void NS::Base::constFunction() const\00"
// CHECK-DAG: private unnamed_addr constant [26 x i8] c"functionReturingTemplate2\00"
-// CHECK-DAG: private unnamed_addr constant [64 x i8] c"ClassTemplate<NS::Base *> NS::Base::functionReturingTemplate2()\00"
+// CHECK-DAG: private unnamed_addr constant [60 x i8] c"ClassTemplate<Base *> NS::Base::functionReturingTemplate2()\00"
// CHECK-DAG: private unnamed_addr constant [26 x i8] c"functionReturingTemplate1\00"
// CHECK-DAG: private unnamed_addr constant [57 x i8] c"ClassTemplate<int> NS::Base::functionReturingTemplate1()\00"
// CHECK-DAG: private unnamed_addr constant [23 x i8] c"withTemplateParameter2\00"
-// CHECK-DAG: private unnamed_addr constant [65 x i8] c"void NS::Base::withTemplateParameter2(ClassTemplate<NS::Base *>)\00"
+// CHECK-DAG: private unnamed_addr constant [61 x i8] c"void NS::Base::withTemplateParameter2(ClassTemplate<Base *>)\00"
// CHECK-DAG: private unnamed_addr constant [23 x i8] c"withTemplateParameter1\00"
// CHECK-DAG: private unnamed_addr constant [58 x i8] c"void NS::Base::withTemplateParameter1(ClassTemplate<int>)\00"
// CHECK-DAG: private unnamed_addr constant [23 x i8] c"functionReturningClass\00"
-// CHECK-DAG: private unnamed_addr constant [45 x i8] c"NS::Base *NS::Base::functionReturningClass()\00"
+// CHECK-DAG: private unnamed_addr constant [41 x i8] c"Base *NS::Base::functionReturningClass()\00"
// CHECK-DAG: private unnamed_addr constant [23 x i8] c"functionWithParameters\00"
-// CHECK-DAG: private unnamed_addr constant [64 x i8] c"void NS::Base::functionWithParameters(int, float *, NS::Base *)\00"
+// CHECK-DAG: private unnamed_addr constant [60 x i8] c"void NS::Base::functionWithParameters(int, float *, Base *)\00"
// CHECK-DAG: private unnamed_addr constant [17 x i8] c"variadicFunction\00"
// CHECK-DAG: private unnamed_addr constant [42 x i8] c"void NS::Base::variadicFunction(int, ...)\00"
// CHECK-2-NEXT: -- (Test2::A, 0) vtable address --
// CHECK-2-NEXT: 2 | void Test2::A::f()
// CHECK-2-NEXT: 3 | void Test2::A::f() const
-// CHECK-2-NEXT: 4 | Test2::A *Test2::A::g(int)
+// CHECK-2-NEXT: 4 | A *Test2::A::g(int)
// CHECK-2-NEXT: 5 | Test2::A::~A() [complete]
// CHECK-2-NEXT: 6 | Test2::A::~A() [deleting]
// CHECK-2-NEXT: 7 | void Test2::A::h()
-// CHECK-2-NEXT: 8 | Test2::A &Test2::A::operator=(const Test2::A &)
+// CHECK-2-NEXT: 8 | A &Test2::A::operator=(const A &)
//
// CHECK-2: VTable indices for 'Test2::A' (7 entries).
// CHECK-2-NEXT: 0 | void Test2::A::f()
// CHECK-2-NEXT: 1 | void Test2::A::f() const
-// CHECK-2-NEXT: 2 | Test2::A *Test2::A::g(int)
+// CHECK-2-NEXT: 2 | A *Test2::A::g(int)
// CHECK-2-NEXT: 3 | Test2::A::~A() [complete]
// CHECK-2-NEXT: 4 | Test2::A::~A() [deleting]
// CHECK-2-NEXT: 5 | void Test2::A::h()
-// CHECK-2-NEXT: 6 | Test2::A &Test2::A::operator=(const Test2::A &)
+// CHECK-2-NEXT: 6 | A &Test2::A::operator=(const A &)
struct A {
virtual void f();
virtual void f() const;
// CHECK-8-NEXT: 1 | Test4::B RTTI
// CHECK-8-NEXT: -- (Test4::A, 0) vtable address --
// CHECK-8-NEXT: -- (Test4::B, 0) vtable address --
-// CHECK-8-NEXT: 2 | Test4::R3 *Test4::B::f()
+// CHECK-8-NEXT: 2 | R3 *Test4::B::f()
// CHECK-8-NEXT: [return adjustment: 4 non-virtual]
-// CHECK-8-NEXT: 3 | Test4::R3 *Test4::B::f()
+// CHECK-8-NEXT: 3 | R3 *Test4::B::f()
//
// CHECK-8: VTable indices for 'Test4::B' (1 entries).
-// CHECK-8-NEXT: 1 | Test4::R3 *Test4::B::f()
+// CHECK-8-NEXT: 1 | R3 *Test4::B::f()
struct B : A {
virtual R3 *f();
};
// CHECK-9-NEXT: 1 | Test4::D RTTI
// CHECK-9-NEXT: -- (Test4::C, 0) vtable address --
// CHECK-9-NEXT: -- (Test4::D, 0) vtable address --
-// CHECK-9-NEXT: 2 | Test4::V2 *Test4::D::f()
+// CHECK-9-NEXT: 2 | V2 *Test4::D::f()
// CHECK-9-NEXT: [return adjustment: 0 non-virtual, -24 vbase offset offset]
-// CHECK-9-NEXT: 3 | Test4::V2 *Test4::D::f()
+// CHECK-9-NEXT: 3 | V2 *Test4::D::f()
//
// CHECK-9: VTable indices for 'Test4::D' (1 entries).
-// CHECK-9-NEXT: 1 | Test4::V2 *Test4::D::f()
+// CHECK-9-NEXT: 1 | V2 *Test4::D::f()
struct D : C {
virtual V2 *f();
};
// CHECK-10-NEXT: 1 | Test4::E RTTI
// CHECK-10-NEXT: -- (Test4::A, 0) vtable address --
// CHECK-10-NEXT: -- (Test4::E, 0) vtable address --
-// CHECK-10-NEXT: 2 | Test4::V3 *Test4::E::f()
+// CHECK-10-NEXT: 2 | V3 *Test4::E::f()
// CHECK-10-NEXT: [return adjustment: 4 non-virtual, -24 vbase offset offset]
-// CHECK-10-NEXT: 3 | Test4::V3 *Test4::E::f()
+// CHECK-10-NEXT: 3 | V3 *Test4::E::f()
//
// CHECK-10: VTable indices for 'Test4::E' (1 entries).
-// CHECK-10-NEXT: 1 | Test4::V3 *Test4::E::f()
+// CHECK-10-NEXT: 1 | V3 *Test4::E::f()
struct E : A {
virtual V3 *f();
};
// CHECK-11-NEXT: 1 | Test4::F RTTI
// CHECK-11-NEXT: -- (Test4::A, 0) vtable address --
// CHECK-11-NEXT: -- (Test4::F, 0) vtable address --
-// CHECK-11-NEXT: 2 | Test4::R3 *Test4::F::f() [pure]
+// CHECK-11-NEXT: 2 | R3 *Test4::F::f() [pure]
// CHECK-11-NEXT: 3 | void Test4::F::g()
-// CHECK-11-NEXT: 4 | Test4::R3 *Test4::F::f() [pure]
+// CHECK-11-NEXT: 4 | R3 *Test4::F::f() [pure]
//
// CHECK-11: VTable indices for 'Test4::F' (2 entries).
// CHECK-11-NEXT: 1 | void Test4::F::g()
-// CHECK-11-NEXT: 2 | Test4::R3 *Test4::F::f()
+// CHECK-11-NEXT: 2 | R3 *Test4::F::f()
struct F : A {
virtual void g();
virtual R3 *f() = 0;
// CHECK-36-NEXT: 3 | Test29::B RTTI
// CHECK-36-NEXT: -- (Test29::A, 0) vtable address --
// CHECK-36-NEXT: -- (Test29::B, 0) vtable address --
-// CHECK-36-NEXT: 4 | Test29::V2 *Test29::B::f()
+// CHECK-36-NEXT: 4 | V2 *Test29::B::f()
// CHECK-36-NEXT: [return adjustment: 0 non-virtual, -24 vbase offset offset]
// CHECK-36-NEXT: [this adjustment: 0 non-virtual, -24 vcall offset offset]
-// CHECK-36-NEXT: 5 | Test29::V2 *Test29::B::f()
+// CHECK-36-NEXT: 5 | V2 *Test29::B::f()
//
// CHECK-36: VTable indices for 'Test29::B' (1 entries).
-// CHECK-36-NEXT: 1 | Test29::V2 *Test29::B::f()
+// CHECK-36-NEXT: 1 | V2 *Test29::B::f()
struct B : virtual A {
virtual V2 *f();
};
};
// CHECK-43: VTable indices for 'Test37::C' (1 entries).
-// CHECK-43-NEXT: 1 | Test37::C *Test37::C::f()
+// CHECK-43-NEXT: 1 | C *Test37::C::f()
struct C : B {
virtual C* f();
};
int f() {
Cl0 c;
- return c->a; // expected-error {{member reference type 'PR15045::Cl0' is not a pointer; did you mean to use '.'?}}
+ return c->a; // expected-error {{member reference type 'Cl0' is not a pointer; did you mean to use '.'?}}
}
}
};
void bar(Bar *o) {
- o.~Bar(); // expected-error {{member reference type 'dotPointerDestructor::Bar *' is a pointer; did you mean to use '->'}}
+ o.~Bar(); // expected-error {{member reference type 'Bar *' is a pointer; did you mean to use '->'}}
} // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:4-[[@LINE-1]]:5}:"->"
}
// CHECK-OVERRIDE-FINAL: Identifier: "Derived" [6:7 - 6:14] ClassDecl=Derived:6:7 (Definition)
// CHECK-OVERRIDE-FINAL: Keyword: "final" [6:15 - 6:20] attribute(final)=
// CHECK-OVERRIDE-FINAL: Punctuation: ":" [6:21 - 6:22] ClassDecl=Derived:6:7 (Definition)
-// CHECK-OVERRIDE-FINAL: Keyword: "public" [6:23 - 6:29] C++ base class specifier=class Base:1:7 [access=public isVirtual=false]
+// CHECK-OVERRIDE-FINAL: Keyword: "public" [6:23 - 6:29] C++ base class specifier=Base:1:7 [access=public isVirtual=false]
// CHECK-OVERRIDE-FINAL: Identifier: "Base" [6:30 - 6:34] TypeRef=class Base:1:7
// CHECK-OVERRIDE-FINAL: Punctuation: "{" [6:35 - 6:36] ClassDecl=Derived:6:7 (Definition)
// CHECK-OVERRIDE-FINAL: Keyword: "virtual" [7:3 - 7:10] CXXMethod=f:7:16 (virtual) [Overrides @3:16]
// CHECK: <Declaration>Test()</Declaration>
// CHECK: <Declaration>unsigned int getID() const</Declaration>
// CHECK: <Declaration>~Test(){{( noexcept)?}}</Declaration>
-// CHECK: <Declaration>Test::data *reserved</Declaration>
+// CHECK: <Declaration>data *reserved</Declaration>
class S {
};
}
// CHECK: <Declaration>void f(const T &t = T())</Declaration>
-// CHECK: <Declaration>friend void vector<A>::f(const test3::A &)</Declaration>
+// CHECK: <Declaration>friend void vector<A>::f(const A &)</Declaration>
class MyClass
{
// CHECK: FieldDecl=a:4:13 (Definition) [type=T] [typekind=Unexposed] [canonicaltype=type-parameter-0-0] [canonicaltypekind=Unexposed] [isPOD=0]
// CHECK: TypeRef=T:3:16 [type=T] [typekind=Unexposed] [canonicaltype=type-parameter-0-0] [canonicaltypekind=Unexposed] [isPOD=0]
// CHECK: ClassDecl=B:6:7 (Definition) [type=B] [typekind=Record] [isPOD=0]
-// CHECK: C++ base class specifier=A<int>:4:7 [access=public isVirtual=false] [type=A<int>] [typekind=Unexposed] [templateargs/1= [type=int] [typekind=Int]] [canonicaltype=A<int>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=int] [typekind=Int]] [isPOD=0] [nbFields=1]
+// CHECK: C++ base class specifier=A<int>:4:7 [access=public isVirtual=false] [type=A<int>] [typekind=Elaborated] [templateargs/1= [type=int] [typekind=Int]] [canonicaltype=A<int>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=int] [typekind=Int]] [isPOD=0] [nbFields=1]
// CHECK: TemplateRef=A:4:7 [type=] [typekind=Invalid] [isPOD=0]
// CHECK: ClassDecl=C:10:7 (Definition) [type=C] [typekind=Record] [isPOD=0]
-// CHECK: C++ base class specifier=A<float>:4:7 [access=public isVirtual=false] [type=A<float>] [typekind=Unexposed] [templateargs/1= [type=float] [typekind=Float]] [canonicaltype=A<float>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=float] [typekind=Float]] [isPOD=0] [nbFields=1]
+// CHECK: C++ base class specifier=A<float>:4:7 [access=public isVirtual=false] [type=A<float>] [typekind=Elaborated] [templateargs/1= [type=float] [typekind=Float]] [canonicaltype=A<float>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=float] [typekind=Float]] [isPOD=0] [nbFields=1]
// CHECK: TemplateRef=A:4:7 [type=] [typekind=Invalid] [isPOD=0]
// CHECK-KEEP-GOING-ONLY: VarDecl=global_var:1:12 [type=int] [typekind=Int] [isPOD=1]
// CHECK: load-stmts.cpp:18:7: ClassDecl=B:18:7 (Definition) Extent=[18:1 - 20:2]
// CHECK: load-stmts.cpp:19:8: CXXMethod=doB:19:8 Extent=[19:3 - 19:13]
// CHECK: load-stmts.cpp:22:7: ClassDecl=C:22:7 (Definition) Extent=[22:1 - 24:2]
-// CHECK: load-stmts.cpp:22:18: C++ base class specifier=class A:14:7 [access=public isVirtual=false]
-// CHECK: load-stmts.cpp:22:29: C++ base class specifier=class B:18:7 [access=private isVirtual=false]
+// CHECK: load-stmts.cpp:22:18: C++ base class specifier=A:14:7 [access=public isVirtual=false]
+// CHECK: load-stmts.cpp:22:29: C++ base class specifier=B:18:7 [access=private isVirtual=false]
// CHECK: load-stmts.cpp:23:8: CXXMethod=doC:23:8 Extent=[23:3 - 23:13]
// CHECK: load-stmts.cpp:26:7: ClassDecl=D:26:7 (Definition) Extent=[26:1 - 26:49]
-// CHECK: load-stmts.cpp:26:26: C++ base class specifier=class C:22:7 [access=public isVirtual=true]
-// CHECK: load-stmts.cpp:26:45: C++ base class specifier=class A:14:7 [access=private isVirtual=true]
+// CHECK: load-stmts.cpp:26:26: C++ base class specifier=C:22:7 [access=public isVirtual=true]
+// CHECK: load-stmts.cpp:26:45: C++ base class specifier=A:14:7 [access=private isVirtual=true]
// CHECK: load-stmts.cpp:33:7: VarDecl=typeid_marker:33:7 (Definition)
// CHECK: load-stmts.cpp:34:10: TypeRef=class C:22:7 Extent=[34:10 - 34:11]
// CHECK: load-stmts.cpp:35:10: DeclRefExpr=c:32:20 Extent=[35:10 - 35:11]
}
// CHECK: VarDecl=scalarHalf:11:8 (Definition){{( \(invalid\))?}} [type=__private half] [typekind=Half] [isPOD=1]
-// CHECK: VarDecl=vectorHalf:12:9 (Definition) [type=__private half4] [typekind=Typedef] [canonicaltype=half __private __attribute__((ext_vector_type(4)))] [canonicaltypekind=ExtVector] [isPOD=1]
+// CHECK: VarDecl=vectorHalf:12:9 (Definition) [type=__private half4] [typekind=Elaborated] [canonicaltype=half __private __attribute__((ext_vector_type(4)))] [canonicaltypekind=ExtVector] [isPOD=1]
// CHECK: VarDecl=scalarFloat:13:9 (Definition) [type=__private float] [typekind=Float] [isPOD=1]
-// CHECK: VarDecl=vectorFloat:14:10 (Definition) [type=__private float4] [typekind=Typedef] [canonicaltype=float __private __attribute__((ext_vector_type(4)))] [canonicaltypekind=ExtVector] [isPOD=1]
+// CHECK: VarDecl=vectorFloat:14:10 (Definition) [type=__private float4] [typekind=Elaborated] [canonicaltype=float __private __attribute__((ext_vector_type(4)))] [canonicaltypekind=ExtVector] [isPOD=1]
// CHECK: VarDecl=scalarDouble:15:10 (Definition){{( \(invalid\))?}} [type=__private double] [typekind=Double] [isPOD=1]
-// CHECK: VarDecl=vectorDouble:16:11 (Definition){{( \(invalid\))?}} [type=__private double4] [typekind=Typedef] [canonicaltype=double __private __attribute__((ext_vector_type(4)))] [canonicaltypekind=ExtVector] [isPOD=1]
+// CHECK: VarDecl=vectorDouble:16:11 (Definition){{( \(invalid\))?}} [type=__private double4] [typekind=Elaborated] [canonicaltype=double __private __attribute__((ext_vector_type(4)))] [canonicaltypekind=ExtVector] [isPOD=1]
#pragma OPENCL EXTENSION cl_khr_gl_msaa_sharing : enable
reserve_id_t scalarOCLReserveID;
}
-// CHECK: VarDecl=scalarOCLSampler:117:19 (Definition) [type=const sampler_t] [typekind=Typedef] const [canonicaltype=const sampler_t] [canonicaltypekind=OCLSampler] [isPOD=1]
-// CHECK: VarDecl=scalarOCLEvent:118:15 (Definition) [type=__private clk_event_t] [typekind=Typedef] [canonicaltype=__private clk_event_t] [canonicaltypekind=Unexposed] [isPOD=1]
-// CHECK: VarDecl=scalarOCLQueue:119:11 (Definition) [type=__private queue_t] [typekind=Typedef] [canonicaltype=__private queue_t] [canonicaltypekind=OCLQueue] [isPOD=1]
-// CHECK: VarDecl=scalarOCLReserveID:120:16 (Definition) [type=__private reserve_id_t] [typekind=Typedef] [canonicaltype=__private reserve_id_t] [canonicaltypekind=OCLReserveID] [isPOD=1]
+// CHECK: VarDecl=scalarOCLSampler:117:19 (Definition) [type=const sampler_t] [typekind=Elaborated] const [canonicaltype=const sampler_t] [canonicaltypekind=OCLSampler] [isPOD=1]
+// CHECK: VarDecl=scalarOCLEvent:118:15 (Definition) [type=__private clk_event_t] [typekind=Elaborated] [canonicaltype=__private clk_event_t] [canonicaltypekind=Unexposed] [isPOD=1]
+// CHECK: VarDecl=scalarOCLQueue:119:11 (Definition) [type=__private queue_t] [typekind=Elaborated] [canonicaltype=__private queue_t] [canonicaltypekind=OCLQueue] [isPOD=1]
+// CHECK: VarDecl=scalarOCLReserveID:120:16 (Definition) [type=__private reserve_id_t] [typekind=Elaborated] [canonicaltype=__private reserve_id_t] [canonicaltypekind=OCLReserveID] [isPOD=1]
#pragma OPENCL EXTENSION cl_intel_device_side_avc_motion_estimation : enable
intel_sub_group_avc_mce_payload_t mce_payload;
}
-// CHECK: VarDecl=mce_payload:131:37 (Definition){{( \(invalid\))?}} [type=__private intel_sub_group_avc_mce_payload_t] [typekind=Typedef] [canonicaltype=__private intel_sub_group_avc_mce_payload_t] [canonicaltypekind=OCLIntelSubgroupAVCMcePayload] [isPOD=1]
+// CHECK: VarDecl=mce_payload:131:37 (Definition){{( \(invalid\))?}} [type=__private intel_sub_group_avc_mce_payload_t] [typekind=Elaborated] [canonicaltype=__private intel_sub_group_avc_mce_payload_t] [canonicaltypekind=OCLIntelSubgroupAVCMcePayload] [isPOD=1]
typedef int MyTypedef;
// CHECK-TYPE: VarDecl=VariableWithParentheses2:
-// CHECK-TYPE-SAME: [type=MyTypedef] [typekind=Typedef]
+// CHECK-TYPE-SAME: [type=MyTypedef] [typekind=Elaborated]
// CHECK-TYPE-SAME: [canonicaltype=int] [canonicaltypekind=Int]
// CHECK-TYPEDECL: VarDecl=VariableWithParentheses2
// CHECK-TYPEDECL-SAME: [typedeclaration=MyTypedef] [typekind=Typedef]
struct simple s1;
};
-// CHECK64: VarDecl=s1:[[@LINE+2]]:8 (Definition) [type=basic::simple] [typekind=Record] [sizeof=48] [alignof=8]
-// CHECK32: VarDecl=s1:[[@LINE+1]]:8 (Definition) [type=basic::simple] [typekind=Record] [sizeof=36] [alignof=4]
+// CHECK64: VarDecl=s1:[[@LINE+2]]:8 (Definition) [type=simple] [typekind=Elaborated] [sizeof=48] [alignof=8]
+// CHECK32: VarDecl=s1:[[@LINE+1]]:8 (Definition) [type=simple] [typekind=Elaborated] [sizeof=36] [alignof=4]
simple s1;
struct Test {
BaseStruct(){}
double v0;
float v1;
-// CHECK64: FieldDecl=fg:[[@LINE+2]]:7 (Definition) [type=Test3::C] [typekind=Record] [sizeof=88] [alignof=8] [offsetof=128]
-// CHECK32: FieldDecl=fg:[[@LINE+1]]:7 (Definition) [type=Test3::C] [typekind=Record] [sizeof=60] [alignof=4] [offsetof=96]
+// CHECK64: FieldDecl=fg:[[@LINE+2]]:7 (Definition) [type=C] [typekind=Elaborated] [sizeof=88] [alignof=8] [offsetof=128]
+// CHECK32: FieldDecl=fg:[[@LINE+1]]:7 (Definition) [type=C] [typekind=Elaborated] [sizeof=60] [alignof=4] [offsetof=96]
C fg;
-// CHECK64: FieldDecl=rg:[[@LINE+2]]:8 (Definition) [type=Test3::C &] [typekind=LValueReference] [sizeof=88] [alignof=8] [offsetof=832]
-// CHECK32: FieldDecl=rg:[[@LINE+1]]:8 (Definition) [type=Test3::C &] [typekind=LValueReference] [sizeof=60] [alignof=4] [offsetof=576]
+// CHECK64: FieldDecl=rg:[[@LINE+2]]:8 (Definition) [type=C &] [typekind=LValueReference] [sizeof=88] [alignof=8] [offsetof=832]
+// CHECK32: FieldDecl=rg:[[@LINE+1]]:8 (Definition) [type=C &] [typekind=LValueReference] [sizeof=60] [alignof=4] [offsetof=576]
C &rg;
int x;
};
_Atomic(unsigned long) aul;
// RUN: c-index-test -test-print-type %s | FileCheck %s
-// CHECK: FunctionDecl=f:3:6 (Definition) [type=int *(int *, char *, FooType, int *, void (*)(int))] [typekind=FunctionProto] [canonicaltype=int *(int *, char *, int, int *, void (*)(int))] [canonicaltypekind=FunctionProto] [resulttype=int *] [resulttypekind=Pointer] [args= [int *] [Pointer] [char *] [Pointer] [FooType] [Typedef] [int[5]] [ConstantArray] [void (*)(int)] [Pointer]] [isPOD=0]
+// CHECK: FunctionDecl=f:3:6 (Definition) [type=int *(int *, char *, FooType, int *, void (*)(int))] [typekind=FunctionProto] [canonicaltype=int *(int *, char *, int, int *, void (*)(int))] [canonicaltypekind=FunctionProto] [resulttype=int *] [resulttypekind=Pointer] [args= [int *] [Pointer] [char *] [Pointer] [FooType] [Elaborated] [int[5]] [ConstantArray] [void (*)(int)] [Pointer]] [isPOD=0]
// CHECK: ParmDecl=p:3:13 (Definition) [type=int *] [typekind=Pointer] [isPOD=1] [pointeetype=int] [pointeekind=Int]
// CHECK: ParmDecl=x:3:22 (Definition) [type=char *] [typekind=Pointer] [isPOD=1] [pointeetype=char] [pointeekind=Char_{{[US]}}]
-// CHECK: ParmDecl=z:3:33 (Definition) [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
+// CHECK: ParmDecl=z:3:33 (Definition) [type=FooType] [typekind=Elaborated] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
// CHECK: TypeRef=FooType:1:13 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
// CHECK: ParmDecl=arr:3:40 (Definition) [type=int[5]] [typekind=ConstantArray] [isPOD=1]
// CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1]
// CHECK: UnaryOperator= [type=int] [typekind=Int] [isPOD=1]
// CHECK: DeclRefExpr=p:3:13 [type=int *] [typekind=Pointer] [isPOD=1] [pointeetype=int] [pointeekind=Int]
// CHECK: DeclStmt= [type=] [typekind=Invalid] [isPOD=0]
-// CHECK: VarDecl=w:5:17 (Definition) [type=const FooType] [typekind=Typedef] const [canonicaltype=const int] [canonicaltypekind=Int] [isPOD=1]
+// CHECK: VarDecl=w:5:17 (Definition) [type=const FooType] [typekind=Elaborated] const [canonicaltype=const int] [canonicaltypekind=Int] [isPOD=1]
// CHECK: TypeRef=FooType:1:13 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
-// CHECK: DeclRefExpr=z:3:33 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
+// CHECK: DeclRefExpr=z:3:33 [type=FooType] [typekind=Elaborated] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
// CHECK: ReturnStmt= [type=] [typekind=Invalid] [isPOD=0]
// CHECK: BinaryOperator= [type=int *] [typekind=Pointer] [isPOD=1] [pointeetype=int] [pointeekind=Int]
// CHECK: BinaryOperator= [type=int *] [typekind=Pointer] [isPOD=1] [pointeetype=int] [pointeekind=Int]
// CHECK: DeclRefExpr=p:3:13 [type=int *] [typekind=Pointer] [isPOD=1] [pointeetype=int] [pointeekind=Int]
-// CHECK: DeclRefExpr=z:3:33 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
+// CHECK: DeclRefExpr=z:3:33 [type=FooType] [typekind=Elaborated] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
// CHECK: ArraySubscriptExpr= [type=int] [typekind=Int] [isPOD=1]
// CHECK: UnexposedExpr=arr:3:40 [type=int[5]] [typekind=ConstantArray] [isPOD=1]
// CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1]
// CHECK: TypedefDecl=FooType:19:15 (Definition) [type=outer::inner::Bar::FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
// CHECK: TypeAliasDecl=AliasType:20:9 (Definition) [type=outer::inner::Bar::AliasType] [typekind=Typedef] [canonicaltype=double] [canonicaltypekind=Double] [isPOD=1]
// CHECK: FieldDecl=p:21:8 (Definition) [type=int *] [typekind=Pointer] [isPOD=1] [pointeetype=int] [pointeekind=Int]
-// CHECK: CXXMethod=f:22:8 (Definition) [type=int *(int *, char *, outer::inner::Bar::FooType){{.*}}] [typekind=FunctionProto] [canonicaltype=int *(int *, char *, int){{.*}}] [canonicaltypekind=FunctionProto] [resulttype=int *] [resulttypekind=Pointer] [args= [int *] [Pointer] [char *] [Pointer] [outer::inner::Bar::FooType] [Typedef]] [isPOD=0]
+// CHECK: CXXMethod=f:22:8 (Definition) [type=int *(int *, char *, FooType){{.*}}] [typekind=FunctionProto] [canonicaltype=int *(int *, char *, int){{.*}}] [canonicaltypekind=FunctionProto] [resulttype=int *] [resulttypekind=Pointer] [args= [int *] [Pointer] [char *] [Pointer] [FooType] [Elaborated]] [isPOD=0]
// CHECK: ParmDecl=p:22:15 (Definition) [type=int *] [typekind=Pointer] [isPOD=1] [pointeetype=int] [pointeekind=Int]
// CHECK: ParmDecl=x:22:24 (Definition) [type=char *] [typekind=Pointer] [isPOD=1] [pointeetype=char] [pointeekind=Char_{{[US]}}]
-// CHECK: ParmDecl=z:22:35 (Definition) [type=outer::inner::Bar::FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
+// CHECK: ParmDecl=z:22:35 (Definition) [type=FooType] [typekind=Elaborated] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
// CHECK: TypeRef=outer::inner::Bar::FooType:19:15 [type=outer::inner::Bar::FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
// CHECK: CompoundStmt= [type=] [typekind=Invalid] [isPOD=0]
// CHECK: DeclStmt= [type=] [typekind=Invalid] [isPOD=0]
-// CHECK: VarDecl=w:23:19 (Definition) [type=const outer::inner::Bar::FooType] [typekind=Typedef] const [canonicaltype=const int] [canonicaltypekind=Int] [isPOD=1]
+// CHECK: VarDecl=w:23:19 (Definition) [type=const FooType] [typekind=Elaborated] const [canonicaltype=const int] [canonicaltypekind=Int] [isPOD=1]
// CHECK: TypeRef=outer::inner::Bar::FooType:19:15 [type=outer::inner::Bar::FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
-// CHECK: UnexposedExpr=z:22:35 [type=outer::inner::Bar::FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
-// CHECK: DeclRefExpr=z:22:35 [type=outer::inner::Bar::FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
+// CHECK: UnexposedExpr=z:22:35 [type=FooType] [typekind=Elaborated] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
+// CHECK: DeclRefExpr=z:22:35 [type=FooType] [typekind=Elaborated] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
// CHECK: ReturnStmt= [type=] [typekind=Invalid] [isPOD=0]
// CHECK: BinaryOperator= [type=int *] [typekind=Pointer] [isPOD=1] [pointeetype=int] [pointeekind=Int]
// CHECK: UnexposedExpr=p:22:15 [type=int *] [typekind=Pointer] [isPOD=1] [pointeetype=int] [pointeekind=Int]
// CHECK: DeclRefExpr=p:22:15 [type=int *] [typekind=Pointer] [isPOD=1] [pointeetype=int] [pointeekind=Int]
-// CHECK: UnexposedExpr=z:22:35 [type=outer::inner::Bar::FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
-// CHECK: DeclRefExpr=z:22:35 [type=outer::inner::Bar::FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
+// CHECK: UnexposedExpr=z:22:35 [type=FooType] [typekind=Elaborated] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
+// CHECK: DeclRefExpr=z:22:35 [type=FooType] [typekind=Elaborated] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
// CHECK: TypedefDecl=OtherType:26:18 (Definition) [type=outer::inner::Bar::OtherType] [typekind=Typedef] [canonicaltype=double] [canonicaltypekind=Double] [isPOD=1]
// CHECK: TypedefDecl=ArrayType:27:15 (Definition) [type=outer::inner::Bar::ArrayType] [typekind=Typedef] [canonicaltype=int[5]] [canonicaltypekind=ConstantArray] [isPOD=1]
// CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1]
-// CHECK: FieldDecl=baz:28:20 (Definition) [type=Baz<int, 1, outer::Foo>] [typekind=Unexposed] [templateargs/3= [type=int] [typekind=Int]] [canonicaltype=outer::Baz<int, 1, outer::Foo>] [canonicaltypekind=Record] [canonicaltemplateargs/3= [type=int] [typekind=Int]] [isPOD=1]
+// CHECK: FieldDecl=baz:28:20 (Definition) [type=Baz<int, 1, outer::Foo>] [typekind=Elaborated] [templateargs/3= [type=int] [typekind=Int]] [canonicaltype=outer::Baz<int, 1, outer::Foo>] [canonicaltypekind=Record] [canonicaltemplateargs/3= [type=int] [typekind=Int]] [isPOD=1]
// CHECK: TemplateRef=Baz:9:8 [type=] [typekind=Invalid] [isPOD=0]
// CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1]
// CHECK: TemplateRef=Foo:4:8 [type=] [typekind=Invalid] [isPOD=0]
-// CHECK: FieldDecl=qux:29:38 (Definition) [type=Qux<int, char *, Foo<int>, outer::inner::Bar::FooType>] [typekind=Unexposed] [templateargs/4= [type=int] [typekind=Int] [type=char *] [typekind=Pointer] [type=Foo<int>] [typekind=Unexposed] [type=outer::inner::Bar::FooType] [typekind=Typedef]] [canonicaltype=outer::Qux<int, char *, outer::Foo<int>, int>] [canonicaltypekind=Record] [canonicaltemplateargs/4= [type=int] [typekind=Int] [type=char *] [typekind=Pointer] [type=outer::Foo<int>] [typekind=Record] [type=int] [typekind=Int]] [isPOD=1]
+// CHECK: FieldDecl=qux:29:38 (Definition) [type=Qux<int, char *, Foo<int>, FooType>] [typekind=Elaborated] [templateargs/4= [type=int] [typekind=Int] [type=char *] [typekind=Pointer] [type=Foo<int>] [typekind=Elaborated] [type=FooType] [typekind=Elaborated]] [canonicaltype=outer::Qux<int, char *, outer::Foo<int>, int>] [canonicaltypekind=Record] [canonicaltemplateargs/4= [type=int] [typekind=Int] [type=char *] [typekind=Pointer] [type=outer::Foo<int>] [typekind=Record] [type=int] [typekind=Int]] [isPOD=1]
// CHECK: TemplateRef=Qux:12:8 [type=] [typekind=Invalid] [isPOD=0]
// CHECK: TemplateRef=Foo:4:8 [type=] [typekind=Invalid] [isPOD=0]
// CHECK: FunctionTemplate=tbar:36:3 [type=T (int)] [typekind=FunctionProto] [canonicaltype=type-parameter-0-0 (int)] [canonicaltypekind=FunctionProto] [resulttype=T] [resulttypekind=Unexposed] [isPOD=0]
// CHECK: DeclRefExpr=tbar:36:3 RefName=[55:17 - 55:21] RefName=[55:21 - 55:26] [type=int (int)] [typekind=FunctionProto] [canonicaltype=int (int)] [canonicaltypekind=FunctionProto] [isPOD=0]
// CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1]
// CHECK: VarDecl=autoBlob:56:6 (Definition) [type=Blob *] [typekind=Auto] [canonicaltype=Blob *] [canonicaltypekind=Pointer] [isPOD=1]
-// CHECK: CXXNewExpr= [type=Blob *] [typekind=Pointer] [isPOD=1] [pointeetype=Blob] [pointeekind=Record]
+// CHECK: CXXNewExpr= [type=Blob *] [typekind=Pointer] [canonicaltype=Blob *] [canonicaltypekind=Pointer] [isPOD=1] [pointeetype=Blob] [pointeekind=Elaborated]
// CHECK: TypeRef=struct Blob:46:8 [type=Blob] [typekind=Record] [isPOD=1] [nbFields=2]
-// CHECK: CallExpr=Blob:46:8 [type=Blob] [typekind=Record] [isPOD=1] [nbFields=2]
+// CHECK: CallExpr=Blob:46:8 [type=Blob] [typekind=Elaborated] [canonicaltype=Blob] [canonicaltypekind=Record] [isPOD=1] [nbFields=2]
// CHECK: FunctionDecl=autoFunction:57:6 (Definition) [type=int ()] [typekind=FunctionProto] [canonicaltype=int ()] [canonicaltypekind=FunctionProto] [resulttype=int] [resulttypekind=Auto] [isPOD=0]
// CHECK: CompoundStmt= [type=] [typekind=Invalid] [isPOD=0]
// CHECK: ReturnStmt= [type=] [typekind=Invalid] [isPOD=0]
// CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1]
// CHECK: TypeAliasTemplateDecl=TypeAlias:61:1 (Definition) [type=] [typekind=Invalid] [isPOD=0]
// CHECK: TemplateTypeParameter=T:60:20 (Definition) [type=T] [typekind=Unexposed] [canonicaltype=type-parameter-0-0] [canonicaltypekind=Unexposed] [isPOD=0]
-// CHECK: FieldDecl=foo:63:39 (Definition) [type=TypeAlias<int>] [typekind=Unexposed] [templateargs/1= [type=int] [typekind=Int]] [canonicaltype=outer::Qux<int>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=int] [typekind=Int]] [isPOD=1]
+// CHECK: FieldDecl=foo:63:39 (Definition) [type=TypeAlias<int>] [typekind=Elaborated] [templateargs/1= [type=int] [typekind=Int]] [canonicaltype=outer::Qux<int>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=int] [typekind=Int]] [isPOD=1]
// CHECK: TemplateRef=TypeAlias:61:1 [type=] [typekind=Invalid] [isPOD=0]
// CHECK: ClassTemplate=Specialization:66:8 (Definition) [type=] [typekind=Invalid] [isPOD=0]
// CHECK: TemplateTypeParameter=T:65:19 (Definition) [type=T] [typekind=Unexposed] [canonicaltype=type-parameter-0-0] [canonicaltypekind=Unexposed] [isPOD=0]
// CHECK: StructDecl=Specialization:69:8 [Specialization of Specialization:66:8] [type=Specialization<int>] [typekind=Record] [templateargs/1= [type=int] [typekind=Int]] [isPOD=0]
-// CHECK: VarDecl=templRefParam:71:40 (Definition) [type=Specialization<Specialization<bool> &>] [typekind=Unexposed] [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [canonicaltype=Specialization<Specialization<bool> &>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
+// CHECK: VarDecl=templRefParam:71:40 (Definition) [type=Specialization<Specialization<bool> &>] [typekind=Elaborated] [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [canonicaltype=Specialization<Specialization<bool> &>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
// CHECK: TemplateRef=Specialization:66:8 [type=] [typekind=Invalid] [isPOD=0]
-// CHECK: CallExpr=Specialization:66:8 [type=Specialization<Specialization<bool> &>] [typekind=Unexposed] [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [canonicaltype=Specialization<Specialization<bool> &>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
+// CHECK: CallExpr=Specialization:66:8 [type=Specialization<Specialization<bool> &>] [typekind=Elaborated] [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [canonicaltype=Specialization<Specialization<bool> &>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
// CHECK: VarDecl=autoTemplRefParam:72:6 (Definition) [type=Specialization<Specialization<bool> &>] [typekind=Auto] [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [canonicaltype=Specialization<Specialization<bool> &>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
// CHECK: UnexposedExpr=templRefParam:71:40 [type=const Specialization<Specialization<bool> &>] [typekind=Record] const [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
-// CHECK: DeclRefExpr=templRefParam:71:40 [type=Specialization<Specialization<bool> &>] [typekind=Unexposed] [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [canonicaltype=Specialization<Specialization<bool> &>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
-// CHECK: TypeAliasDecl=baz:76:7 (Definition) [type=baz] [typekind=Typedef] [templateargs/1= [type=A<void>] [typekind=Unexposed]] [canonicaltype=A<void>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=void] [typekind=Void]] [isPOD=0]
+// CHECK: DeclRefExpr=templRefParam:71:40 [type=Specialization<Specialization<bool> &>] [typekind=Elaborated] [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [canonicaltype=Specialization<Specialization<bool> &>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
+// CHECK: TypeAliasDecl=baz:76:7 (Definition) [type=baz] [typekind=Typedef] [templateargs/1= [type=A<void>] [typekind=Elaborated]] [canonicaltype=A<void>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=void] [typekind=Void]] [isPOD=0]
// CHECK: VarDecl=autoTemplPointer:78:6 (Definition) [type=Specialization<Specialization<bool> &> *] [typekind=Auto] [canonicaltype=Specialization<Specialization<bool> &> *] [canonicaltypekind=Pointer] [isPOD=1] [pointeetype=Specialization<Specialization<bool> &>] [pointeekind=Auto]
// CHECK: CallExpr=Bar:17:3 [type=outer::inner::Bar] [typekind=Elaborated] [canonicaltype=outer::inner::Bar] [canonicaltypekind=Record] [args= [outer::Foo<bool> *] [Pointer]] [isPOD=0] [nbFields=3]
// CHECK: StructDecl=:84:3 (Definition) [type=X::(anonymous struct at {{.*}}print-type.cpp:84:3)] [typekind=Record] [isPOD=1] [nbFields=1] [isAnon=1]
// CHECK: *** Dumping AST Record Layout
// CHECK-NEXT: 0 | struct B
-// CHECK-NEXT: 0:0-0 | enum Bool b
+// CHECK-NEXT: 0:0-0 | Bool b
// CHECK-NEXT: | [sizeof=4, dsize=4, align=4, preferredalign=4,
// CHECK-NEXT: | nvsize=4, nvalign=4, preferrednvalign=4]
int b = sizeof(A);
// CHECK: 0 | struct test1::A
-// CHECK-NEXT: 0 | test1::Dbl x
+// CHECK-NEXT: 0 | Dbl x
// CHECK-NEXT: | [sizeof=8, dsize=8, align=2, preferredalign=2,
// CHECK-NEXT: | nvsize=8, nvalign=2, preferrednvalign=2]
int x = sizeof(U);
// CHECK: 0 | union test2::U
-// CHECK-NEXT: 0 | test2::DblArr da
+// CHECK-NEXT: 0 | DblArr da
// CHECK-NEXT: 0 | char x
// CHECK-NEXT: | [sizeof=2, dsize=2, align=2, preferredalign=2,
// CHECK-NEXT: | nvsize=2, nvalign=2, preferrednvalign=2]
int x = sizeof(U);
// CHECK: 0 | union test3::U
-// CHECK-NEXT: 0 | test3::DblArr da
+// CHECK-NEXT: 0 | DblArr da
// CHECK-NEXT: 0 | char x
// CHECK-NEXT: | [sizeof=2, dsize=2, align=2, preferredalign=2,
// CHECK-NEXT: | nvsize=2, nvalign=2, preferrednvalign=2]
int x = sizeof(U);
// CHECK: 0 | union test4::U
-// CHECK-NEXT: 0 | test4::Dbl[] DblArr
+// CHECK-NEXT: 0 | Dbl[] DblArr
// CHECK-NEXT: 0 | char x
// CHECK-NEXT: | [sizeof=2, dsize=2, align=2, preferredalign=2,
// CHECK-NEXT: | nvsize=2, nvalign=2, preferrednvalign=2]
} d;
// CHECK: 0 | foo_t
-// CHECK: 0 | c::bar_t
+// CHECK: 0 | bar_t
// CANONICAL-NOT: 0 | foo_t
-// CANONICAL-NOT: 0 | c::bar_t
+// CANONICAL-NOT: 0 | bar_t
// CANONICAL: 0 | long
};
// CHECK-LABEL: 0 | struct ArrayFieldOfRecords{{$}}
-// CHECK-NEXT: 0 | struct A4[2] InlineElts
+// CHECK-NEXT: 0 | A4[2] InlineElts
// CHECK-NEXT: | [sizeof=8, align=4
// CHECK-NEXT: | nvsize=8, nvalign=4]
// CHECK-X64-LABEL: 0 | struct ArrayFieldOfRecords{{$}}
-// CHECK-X64-NEXT: 0 | struct A4[2] InlineElts
+// CHECK-X64-NEXT: 0 | A4[2] InlineElts
// CHECK-X64-NEXT: | [sizeof=8, align=4
// CHECK-X64-NEXT: | nvsize=8, nvalign=4]
};
// CHECK-LABEL: 0 | struct ArrayOfArrayFieldOfRecords{{$}}
-// CHECK-NEXT: 0 | struct A4[2][2] InlineElts
+// CHECK-NEXT: 0 | A4[2][2] InlineElts
// CHECK-NEXT: | [sizeof=16, align=4
// CHECK-NEXT: | nvsize=16, nvalign=4]
// CHECK-X64-LABEL: 0 | struct ArrayOfArrayFieldOfRecords{{$}}
-// CHECK-X64-NEXT: 0 | struct A4[2][2] InlineElts
+// CHECK-X64-NEXT: 0 | A4[2][2] InlineElts
// CHECK-X64-NEXT: | [sizeof=16, align=4
// CHECK-X64-NEXT: | nvsize=16, nvalign=4]
};
// CHECK-LABEL: 0 | struct RecordArrayTypedef{{$}}
-// CHECK-NEXT: 0 | RecordArrayTypedef::ArrayTy[2] InlineElts
+// CHECK-NEXT: 0 | ArrayTy[2] InlineElts
// CHECK-NEXT: | [sizeof=16, align=4
// CHECK-NEXT: | nvsize=16, nvalign=4]
// CHECK-X64-LABEL: 0 | struct RecordArrayTypedef{{$}}
-// CHECK-X64-NEXT: 0 | RecordArrayTypedef::ArrayTy[2] InlineElts
+// CHECK-X64-NEXT: 0 | ArrayTy[2] InlineElts
// CHECK-X64-NEXT: | [sizeof=16, align=4
// CHECK-X64-NEXT: | nvsize=16, nvalign=4]
// CHECK: *** Dumping AST Record Layout
// CHECK: *** Dumping AST Record Layout
// CHECK-NEXT: 0 | struct T3
-// CHECK-NEXT: 0 | struct T2[1] a
+// CHECK-NEXT: 0 | T2[1] a
// CHECK-NEXT: 5 | char c
// CHECK-NEXT: | [sizeof=8, align=4
// CHECK-NEXT: | nvsize=8, nvalign=4]
// CHECK-X64: *** Dumping AST Record Layout
// CHECK-X64: *** Dumping AST Record Layout
// CHECK-X64-NEXT: 0 | struct T3
-// CHECK-X64-NEXT: 0 | struct T2[1] a
+// CHECK-X64-NEXT: 0 | T2[1] a
// CHECK-X64-NEXT: 16 | char c
// CHECK-X64-NEXT: | [sizeof=24, align=8
// CHECK-X64-NEXT: | nvsize=24, nvalign=8]
// Ensure that after line-wrapping takes place, we preserve artificial
// newlines introduced to manually format a section of the diagnostic text.
// CHECK: {{.*}}: error:
- // CHECK: struct DD -> struct D1 -> struct B
- // CHECK: struct DD -> struct D2 -> struct B
+ // CHECK: struct DD -> D1 -> B
+ // CHECK: struct DD -> D2 -> B
};
// A line longer than 4096 characters should cause us to suppress snippets no
using T2 = M<C<N>>;
T2 p;
T1 x = p;
- // CHECK-ELIDE-NOTREE: no viable conversion from 'M<C<DependentInt::N, INT<1>>>' to 'M<C<int, INT<0>>>'
+ // CHECK-ELIDE-NOTREE: no viable conversion from 'M<C<N, INT<1>>>' to 'M<C<int, INT<0>>>'
}
}
void foo() {
vector<Atom *> v;
AtomVector v2(v);
- // CHECK-ELIDE-NOTREE: no known conversion from 'vector<PR17510::Atom *, [...]>' to 'const vector<const PR17510::Atom *, [...]>'
+ // CHECK-ELIDE-NOTREE: no known conversion from 'vector<Atom *, [...]>' to 'const vector<const PR17510::Atom *, [...]>'
}
}
// Test merging when using anonymous namespaces, which does not
// actually perform any merging.
void testAnonymousNotMerged() {
- N11::consumeFoo(N11::getFoo()); // expected-error{{cannot initialize a parameter of type 'N11::(anonymous namespace)::Foo *' with an rvalue of type 'N11::(anonymous namespace)::Foo *'}}
- N12::consumeFoo(N12::getFoo()); // expected-error{{cannot initialize a parameter of type 'N12::(anonymous namespace)::Foo *' with an rvalue of type 'N12::(anonymous namespace)::Foo *'}}
+ N11::consumeFoo(N11::getFoo()); // expected-error{{cannot initialize a parameter of type 'Foo *' with an rvalue of type 'Foo *'}}
+ N12::consumeFoo(N12::getFoo()); // expected-error{{cannot initialize a parameter of type 'Foo *' with an rvalue of type 'Foo *'}}
}
// expected-note@Inputs/namespaces-right.h:60 {{passing argument to parameter here}}
// expected-note@first.h:* {{declaration of 'x' does not match}}
Invalid2 i2;
// expected-error@first.h:* {{'Types::TypeOf::Invalid2' has different definitions in different modules; first difference is definition in module 'FirstModule' found field 'x' with type 'typeof(int)' (aka 'int')}}
-// expected-note@second.h:* {{but in 'SecondModule' found field 'x' with type 'typeof(Types::TypeOf::I)' (aka 'int')}}
+// expected-note@second.h:* {{but in 'SecondModule' found field 'x' with type 'typeof(I)' (aka 'int')}}
Invalid3 i3;
// expected-error@second.h:* {{'Types::TypeOf::Invalid3::x' from module 'SecondModule' is not present in definition of 'Types::TypeOf::Invalid3' in module 'FirstModule'}}
// expected-note@first.h:* {{declaration of 'x' does not match}}
};
#else
S4 s4;
-// expected-error@second.h:* {{'Field::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type 'Field::B' (aka 'int')}}
-// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type 'Field::A' (aka 'int')}}
+// expected-error@second.h:* {{'Field::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type 'B' (aka 'int')}}
+// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type 'A' (aka 'int')}}
S5 s5;
// expected-error@second.h:* {{'Field::S5' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type 'int'}}
-// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type 'Field::A' (aka 'int')}}
+// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type 'A' (aka 'int')}}
#endif
#if defined(FIRST)
#else
S6 s6;
// expected-error@second.h:* {{'TypeDef::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found typedef 'b' with underlying type 'float'}}
-// expected-note@first.h:* {{but in 'FirstModule' found typedef 'b' with different underlying type 'TypeDef::F' (aka 'float')}}
+// expected-note@first.h:* {{but in 'FirstModule' found typedef 'b' with different underlying type 'F' (aka 'float')}}
#endif
#define DECLS \
#else
S6 s6;
// expected-error@second.h:* {{'Using::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found type alias 'b' with underlying type 'float'}}
-// expected-note@first.h:* {{but in 'FirstModule' found type alias 'b' with different underlying type 'Using::F' (aka 'float')}}
+// expected-note@first.h:* {{but in 'FirstModule' found type alias 'b' with different underlying type 'F' (aka 'float')}}
#endif
#if defined(FIRST) || defined(SECOND)
};
#else
S2 s2;
-// expected-error@second.h:* {{'VarDecl::S2' has different definitions in different modules; first difference is definition in module 'SecondModule' found data member 'x' with type 'VarDecl::I' (aka 'int')}}
+// expected-error@second.h:* {{'VarDecl::S2' has different definitions in different modules; first difference is definition in module 'SecondModule' found data member 'x' with type 'I' (aka 'int')}}
// expected-note@first.h:* {{but in 'FirstModule' found data member 'x' with different type 'int'}}
#endif
};
#else
S1 s1;
-// expected-error@second.h:* {{'Friend::S1' has different definitions in different modules; first difference is definition in module 'SecondModule' found friend 'Friend::T1'}}
+// expected-error@second.h:* {{'Friend::S1' has different definitions in different modules; first difference is definition in module 'SecondModule' found friend 'T1'}}
// expected-note@first.h:* {{but in 'FirstModule' found friend 'class T1'}}
#endif
struct S4 : B4b {};
#else
S4 s4;
-// expected-error@second.h:* {{'BaseClass::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1st base class with type 'BaseClass::B4b'}}
-// expected-note@first.h:* {{but in 'FirstModule' found 1st base class with different type 'BaseClass::B4a'}}
+// expected-error@second.h:* {{'BaseClass::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1st base class with type 'B4b'}}
+// expected-note@first.h:* {{but in 'FirstModule' found 1st base class with different type 'B4a'}}
#endif
#if defined(FIRST)
struct S7 : B7a {};
#else
S7 s7;
-// expected-error@second.h:* {{'BaseClass::S7' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1st base class 'BaseClass::B7a' with no access specifier}}
-// expected-note@first.h:* {{but in 'FirstModule' found 1st base class 'BaseClass::B7a' with protected access specifier}}
+// expected-error@second.h:* {{'BaseClass::S7' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1st base class 'B7a' with no access specifier}}
+// expected-note@first.h:* {{but in 'FirstModule' found 1st base class 'B7a' with protected access specifier}}
#endif
#if defined(FIRST)
struct S8 : private B8a {};
#else
S8 s8;
-// expected-error@second.h:* {{'BaseClass::S8' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1st base class 'BaseClass::B8a' with private access specifier}}
-// expected-note@first.h:* {{but in 'FirstModule' found 1st base class 'BaseClass::B8a' with public access specifier}}
+// expected-error@second.h:* {{'BaseClass::S8' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1st base class 'B8a' with private access specifier}}
+// expected-note@first.h:* {{but in 'FirstModule' found 1st base class 'B8a' with public access specifier}}
#endif
#if defined(FIRST)
struct S9 : public B9a {};
#else
S9 s9;
-// expected-error@second.h:* {{'BaseClass::S9' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1st base class 'BaseClass::B9a' with public access specifier}}
-// expected-note@first.h:* {{but in 'FirstModule' found 1st base class 'BaseClass::B9a' with private access specifier}}
+// expected-error@second.h:* {{'BaseClass::S9' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1st base class 'B9a' with public access specifier}}
+// expected-note@first.h:* {{but in 'FirstModule' found 1st base class 'B9a' with private access specifier}}
#endif
#if defined(FIRST)
struct S10 : protected B10a {};
#else
S10 s10;
-// expected-error@second.h:* {{'BaseClass::S10' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1st base class 'BaseClass::B10a' with protected access specifier}}
-// expected-note@first.h:* {{but in 'FirstModule' found 1st base class 'BaseClass::B10a' with no access specifier}}
+// expected-error@second.h:* {{'BaseClass::S10' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1st base class 'B10a' with protected access specifier}}
+// expected-note@first.h:* {{but in 'FirstModule' found 1st base class 'B10a' with no access specifier}}
#endif
#define DECLS
// expected-error@first.h:* {{'Types::UnaryTransform::Invalid1::x' from module 'FirstModule' is not present in definition of 'Types::UnaryTransform::Invalid1' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
Invalid2 i2;
-// expected-error@second.h:* {{'Types::UnaryTransform::Invalid2' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type '__underlying_type(Types::UnaryTransform::E2b)' (aka 'unsigned int')}}
-// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type '__underlying_type(Types::UnaryTransform::E2a)' (aka 'unsigned int')}}
+// expected-error@second.h:* {{'Types::UnaryTransform::Invalid2' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type '__underlying_type(E2b)' (aka 'unsigned int')}}
+// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type '__underlying_type(E2a)' (aka 'unsigned int')}}
Invalid3 i3;
// expected-error@first.h:* {{'Types::UnaryTransform::Invalid3::x' from module 'FirstModule' is not present in definition of 'Types::UnaryTransform::Invalid3' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
Invalid4 i4;
-// expected-error@second.h:* {{'Types::UnaryTransform::Invalid4' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type '__underlying_type(Types::UnaryTransform::E4b)' (aka 'unsigned int')}}
-// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type '__underlying_type(Types::UnaryTransform::E4a)' (aka 'unsigned int')}}
+// expected-error@second.h:* {{'Types::UnaryTransform::Invalid4' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type '__underlying_type(E4b)' (aka 'unsigned int')}}
+// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type '__underlying_type(E4a)' (aka 'unsigned int')}}
Valid1 v1;
Valid2 v2;
Valid3 v3;
#else
int I7 = F7();
// expected-error@second.h:* {{'FunctionDecl::F7' has different definitions in different modules; definition in module 'SecondModule' first difference is return type is 'int'}}
-// expected-note@first.h:* {{but in 'FirstModule' found different return type 'FunctionDecl::I' (aka 'int')}}
+// expected-note@first.h:* {{but in 'FirstModule' found different return type 'I' (aka 'int')}}
#endif
#if defined(FIRST)
int F8(I) { return 0; }
#else
int I8 = F8(1);
-// expected-error@second.h:* {{'FunctionDecl::F8' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st parameter with type 'FunctionDecl::I' (aka 'int')}}
+// expected-error@second.h:* {{'FunctionDecl::F8' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st parameter with type 'I' (aka 'int')}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st parameter with type 'int'}}
#endif
};
// CHECK: };
-// CHECK: class vecchild : public N1::vec {
+// CHECK: class vecchild : public vec {
class vecchild : public vec {
public:
int lenc;
// CHECK: };
#pragma omp declare mapper(id: vec v) map(v.len)
-// CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len){{$}}
+// CHECK: #pragma omp declare mapper (id : vec v) map(tofrom: v.len){{$}}
};
// CHECK: }
// CHECK: ;
// CHECK: template <class T> class dat {
// CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len){{$}}
-// CHECK: #pragma omp declare mapper (id : dat::datin v) map(tofrom: v.in){{$}}
+// CHECK: #pragma omp declare mapper (id : datin v) map(tofrom: v.in){{$}}
// CHECK: };
// CHECK: template<> class dat<double> {
// CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len){{$}}
-// CHECK: #pragma omp declare mapper (id : dat<double>::datin v) map(tofrom: v.in){{$}}
+// CHECK: #pragma omp declare mapper (id : datin v) map(tofrom: v.in){{$}}
// CHECK: };
constexpr int N = 2;
#pragma omp declare reduction(-: struct A : bar(omp_out, omp_in))
}
// CHECK: namespace N1 {
-// CHECK: #pragma omp declare reduction (+ : N1::A : bar(omp_out, omp_in))
+// CHECK: #pragma omp declare reduction (+ : A : bar(omp_out, omp_in))
// CHECK: #pragma omp declare reduction (- : struct A : bar(omp_out, omp_in))
#pragma omp declare reduction(+ : int, char : omp_out *= omp_in)
struct a;
struct b {
b() {
- delete c; // expected-warning {{deleting pointer to incomplete type 'TestDeleteIncompleteClassDefinition::a' may cause undefined behavior}}
+ delete c; // expected-warning {{deleting pointer to incomplete type 'a' may cause undefined behavior}}
}
a *c;
};
// CHECK: TypedefDecl {{.*}} <{{.*}}, col:{{.*}}> col:{{.*}} referenced dynamic_cast_result 'typeof (dynamic_cast<Derived *>(base_ptr))':'Derived *'{{$}}
// CHECK-NEXT: TypeOfExprType {{.*}} 'typeof (dynamic_cast<Derived *>(base_ptr))' sugar{{( imported)?}}{{$}}
// CHECK-NEXT: ParenExpr {{.*}} <col:{{.*}}, col:{{.*}}> 'Derived *'{{$}}
-// CHECK-NEXT: CXXDynamicCastExpr {{.*}} <col:{{.*}}, col:{{.*}}> 'Derived *' dynamic_cast<struct Derived *> <Dynamic>{{$}}
+// CHECK-NEXT: CXXDynamicCastExpr {{.*}} <col:{{.*}}, col:{{.*}}> 'Derived *' dynamic_cast<Derived *> <Dynamic>{{$}}
// CHECK-NEXT: ImplicitCastExpr {{.*}} <col:{{.*}}> 'Base *' <LValueToRValue> part_of_explicit_cast{{$}}
// CHECK-NEXT: DeclRefExpr {{.*}} <col:{{.*}}> 'Base *' lvalue Var {{.*}} 'base_ptr' 'Base *' non_odr_use_unevaluated{{$}}
const int K = 5;
void g() {
// defining-type-specifiers other than cv-qualifiers and 'auto'
- S [a] = s; // expected-error {{cannot be declared with type 'BadSpecifiers::S'}}
+ S [a] = s; // expected-error {{cannot be declared with type 'S'}}
decltype(auto) [b] = s; // expected-error {{cannot be declared with type 'decltype(auto)'}}
auto ([c]) = s; // expected-error {{cannot be declared with parentheses}}
void f() {
pair p0(3);
#if _MSC_VER >= 1900
- pair p = p0; // expected-error {{call to implicitly-deleted copy constructor of 'PR11826::pair'}}
+ pair p = p0; // expected-error {{call to implicitly-deleted copy constructor of 'pair'}}
#else
pair p = p0;
#endif
pair p0(3);
pair p(4);
#if _MSC_VER >= 1900
- p = p0; // expected-error {{object of type 'PR11826_for_symmetry::pair' cannot be assigned because its copy assignment operator is implicitly deleted}}
+ p = p0; // expected-error {{object of type 'pair' cannot be assigned because its copy assignment operator is implicitly deleted}}
#else
p = p0;
#endif
void foo(const C& c ) {}
void bar( void ) {
- foo(C(99)); // expected-error {{allocating an object of abstract class type 'pr12658::C'}}
+ foo(C(99)); // expected-error {{allocating an object of abstract class type 'C'}}
}
}
private:
X &operator=(const X&);
};
- struct Y : virtual X { // expected-note {{::X' has an inaccessible copy assignment}}
+ struct Y : virtual X { // expected-note {{class 'X' has an inaccessible copy assignment}}
virtual ~Y() = 0;
};
- struct Z : Y {}; // expected-note {{::Y' has a deleted copy assignment}}
+ struct Z : Y {}; // expected-note {{class 'Y' has a deleted copy assignment}}
void f(Z &a, const Z &b) { a = b; } // expected-error {{copy assignment operator is implicitly deleted}}
struct RedundantInit : virtual A {
- RedundantInit() : A(0) {} // expected-warning {{initializer for virtual base class 'pr16659::A' of abstract class 'RedundantInit' will never be used}}
+ RedundantInit() : A(0) {} // expected-warning {{initializer for virtual base class 'A' of abstract class 'RedundantInit' will never be used}}
};
}
class B : private A { }; // expected-note {{declared private here}}
void f(B* b) {
- A *a = b; // expected-error{{cannot cast 'T1::B' to its private base class 'T1::A'}}
+ A *a = b; // expected-error{{cannot cast 'B' to its private base class 'A'}}
}
}
class B : A { }; // expected-note {{implicitly declared private here}}
void f(B* b) {
- A *a = b; // expected-error {{cannot cast 'T2::B' to its private base class 'T2::A'}}
+ A *a = b; // expected-error {{cannot cast 'B' to its private base class 'A'}}
}
}
class C : public B {
void f(C *c) {
- A* a = c; // expected-error {{cannot cast 'T6::C' to its private base class 'T6::A'}} \
+ A* a = c; // expected-error {{cannot cast 'C' to its private base class 'A'}} \
// expected-error {{'A' is a private member of 'T6::A'}}
}
};
struct Y1 : X1, virtual A
{};
-struct Y2 : X1, A // expected-warning{{direct base 'A' is inaccessible due to ambiguity:\n struct Y2 -> struct X1 -> struct A\n struct Y2 -> struct A}}
+struct Y2 : X1, A // expected-warning{{direct base 'A' is inaccessible due to ambiguity:\n struct Y2 -> X1 -> A\n struct Y2 -> A}}
{};
struct X2 : A
{};
-struct Z1 : X2, virtual A // expected-warning{{direct base 'A' is inaccessible due to ambiguity:\n struct Z1 -> struct X2 -> struct A\n struct Z1 -> struct A}}
+struct Z1 : X2, virtual A // expected-warning{{direct base 'A' is inaccessible due to ambiguity:\n struct Z1 -> X2 -> A\n struct Z1 -> A}}
{};
-struct Z2 : X2, A // expected-warning{{direct base 'A' is inaccessible due to ambiguity:\n struct Z2 -> struct X2 -> struct A\n struct Z2 -> struct A}}
+struct Z2 : X2, A // expected-warning{{direct base 'A' is inaccessible due to ambiguity:\n struct Z2 -> X2 -> A\n struct Z2 -> A}}
{};
A *y2_to_a(Y2 *p) {
struct Y { X x; };
void test0() {
- auto *y = new Y {}; // expected-error {{temporary of type 'ElementDestructor::X' has private destructor}}
+ auto *y = new Y {}; // expected-error {{temporary of type 'X' has private destructor}}
}
struct S0 { int f; ~S0() = delete; }; // expected-note 3 {{'~S0' has been explicitly marked deleted here}}
const int Test1() {
func(b1, f()); // expected-error {{call to 'func' is ambiguous}}
- return f(); // expected-error {{conversion from 'test0::B' to 'const int' is ambiguous}}
+ return f(); // expected-error {{conversion from 'B' to 'const int' is ambiguous}}
}
// This used to crash when comparing the two operands.
struct C : A { };
struct D : B, C { };
- bool f(D d) { return !d; } // expected-error{{ambiguous conversion from derived class 'rdar8876150::D' to base class 'rdar8876150::A':}}
+ bool f(D d) { return !d; } // expected-error{{ambiguous conversion from derived class 'D' to base class 'rdar8876150::A':}}
}
namespace assignment {
struct S {
~S() {}
};
- _Atomic S s; // expected-error {{_Atomic cannot be applied to type 'non_trivially_copyable::S' which is not trivially copyable}} \
+ _Atomic S s; // expected-error {{_Atomic cannot be applied to type 'S' which is not trivially copyable}} \
// expected-warning {{'_Atomic' is a C11 extension}}
}
typedef void (*fptr_t)(int);
typedef void __attribute__((noreturn)) (*fptr_noreturn_t)(int);
- // expected-note@+1 {{candidate function not viable: no overload of 'bar' matching 'PR15291::fptr_t' (aka 'void (*)(int)') for 1st argument}}
+ // expected-note@+1 {{candidate function not viable: no overload of 'bar' matching 'fptr_t' (aka 'void (*)(int)') for 1st argument}}
void accept_fptr_t(fptr_t f) {
f(42);
}
- // expected-note@+2 {{candidate function not viable: no overload of 'baz' matching 'PR15291::fptr_noreturn_t' (aka 'void (*)(int) __attribute__((noreturn))') for 1st argument}}
- // expected-note@+1 {{candidate function not viable: no overload of 'qux' matching 'PR15291::fptr_noreturn_t' (aka 'void (*)(int) __attribute__((noreturn))') for 1st argument}}
+ // expected-note@+2 {{candidate function not viable: no overload of 'baz' matching 'fptr_noreturn_t' (aka 'void (*)(int) __attribute__((noreturn))') for 1st argument}}
+ // expected-note@+1 {{candidate function not viable: no overload of 'qux' matching 'fptr_noreturn_t' (aka 'void (*)(int) __attribute__((noreturn))') for 1st argument}}
void accept_fptr_noreturn_t(fptr_noreturn_t f) {
f(42);
}
Incomplete &i;
};
void test_incomplete(Incomplete *i, IncompleteMember *im) {
- // expected-error@+1 {{incomplete type 'test_launder::Incomplete' where a complete type is required}}
+ // expected-error@+1 {{incomplete type 'Incomplete' where a complete type is required}}
__builtin_launder(i);
__builtin_launder(&i); // OK
__builtin_launder(im); // OK
typedef void (__cdecl C::*memb_c_cdecl)();
typedef void (__thiscall C::*memb_c_thiscall)();
-// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'NonVariadic::memb_a_default' (aka 'void (NonVariadic::A::*)() __attribute__((thiscall))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'memb_a_default' (aka 'void (NonVariadic::A::*)() __attribute__((thiscall))') for 1st argument}}
void cb_memb_a_default(memb_a_default ptr);
-// expected-note@+2 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'NonVariadic::memb_a_cdecl' (aka 'void (NonVariadic::A::*)() __attribute__((cdecl))') for 1st argument}}
-// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'NonVariadic::memb_a_cdecl' (aka 'void (NonVariadic::A::*)() __attribute__((cdecl))') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_a_cdecl' (aka 'void (NonVariadic::A::*)() __attribute__((cdecl))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_a_cdecl' (aka 'void (NonVariadic::A::*)() __attribute__((cdecl))') for 1st argument}}
void cb_memb_a_cdecl(memb_a_cdecl ptr);
-// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'NonVariadic::memb_a_thiscall' (aka 'void (NonVariadic::A::*)() __attribute__((thiscall))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'memb_a_thiscall' (aka 'void (NonVariadic::A::*)() __attribute__((thiscall))') for 1st argument}}
void cb_memb_a_thiscall(memb_a_thiscall ptr);
-// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'NonVariadic::memb_b_default' (aka 'void (NonVariadic::B::*)() __attribute__((thiscall))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'memb_b_default' (aka 'void (NonVariadic::B::*)() __attribute__((thiscall))') for 1st argument}}
void cb_memb_b_default(memb_b_default ptr);
-// expected-note@+2 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'NonVariadic::memb_b_cdecl' (aka 'void (NonVariadic::B::*)() __attribute__((cdecl))') for 1st argument}}
-// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'NonVariadic::memb_b_cdecl' (aka 'void (NonVariadic::B::*)() __attribute__((cdecl))') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_b_cdecl' (aka 'void (NonVariadic::B::*)() __attribute__((cdecl))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_b_cdecl' (aka 'void (NonVariadic::B::*)() __attribute__((cdecl))') for 1st argument}}
void cb_memb_b_cdecl(memb_b_cdecl ptr);
-// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'NonVariadic::memb_b_thiscall' (aka 'void (NonVariadic::B::*)() __attribute__((thiscall))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'memb_b_thiscall' (aka 'void (NonVariadic::B::*)() __attribute__((thiscall))') for 1st argument}}
void cb_memb_b_thiscall(memb_b_thiscall ptr);
-// expected-note@+3 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'NonVariadic::memb_c_default' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
-// expected-note@+2 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'NonVariadic::memb_c_default' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
-// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'NonVariadic::memb_c_default' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
+// expected-note@+3 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_c_default' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'memb_c_default' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_c_default' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
void cb_memb_c_default(memb_c_default ptr);
-// expected-note@+3 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'NonVariadic::memb_c_cdecl' (aka 'void (NonVariadic::C::*)() __attribute__((cdecl))') for 1st argument}}
-// expected-note@+2 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'NonVariadic::memb_c_cdecl' (aka 'void (NonVariadic::C::*)() __attribute__((cdecl))') for 1st argument}}
-// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'NonVariadic::memb_c_cdecl' (aka 'void (NonVariadic::C::*)() __attribute__((cdecl))') for 1st argument}}
+// expected-note@+3 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_c_cdecl' (aka 'void (NonVariadic::C::*)() __attribute__((cdecl))') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'memb_c_cdecl' (aka 'void (NonVariadic::C::*)() __attribute__((cdecl))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_c_cdecl' (aka 'void (NonVariadic::C::*)() __attribute__((cdecl))') for 1st argument}}
void cb_memb_c_cdecl(memb_c_cdecl ptr);
-// expected-note@+3 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'NonVariadic::memb_c_thiscall' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
-// expected-note@+2 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'NonVariadic::memb_c_thiscall' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
-// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'NonVariadic::memb_c_thiscall' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
+// expected-note@+3 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_c_thiscall' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'memb_c_thiscall' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_c_thiscall' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
void cb_memb_c_thiscall(memb_c_thiscall ptr);
void call_member() {
void cb_memb_a_cdecl(memb_a_cdecl ptr);
void cb_memb_b_default(memb_b_default ptr);
void cb_memb_b_cdecl(memb_b_cdecl ptr);
-// expected-note@+2 {{candidate function not viable: no known conversion from 'void (Variadic::A::*)(int, ...)' to 'Variadic::memb_c_default' (aka 'void (Variadic::C::*)(int, ...)') for 1st argument}}
-// expected-note@+1 {{candidate function not viable: no known conversion from 'void (Variadic::A::*)(int, ...) __attribute__((cdecl))' to 'Variadic::memb_c_default' (aka 'void (Variadic::C::*)(int, ...)') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (Variadic::A::*)(int, ...)' to 'memb_c_default' (aka 'void (Variadic::C::*)(int, ...)') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (Variadic::A::*)(int, ...) __attribute__((cdecl))' to 'memb_c_default' (aka 'void (Variadic::C::*)(int, ...)') for 1st argument}}
void cb_memb_c_default(memb_c_default ptr);
-// expected-note@+2 {{candidate function not viable: no known conversion from 'void (Variadic::A::*)(int, ...)' to 'Variadic::memb_c_cdecl' (aka 'void (Variadic::C::*)(int, ...) __attribute__((cdecl))') for 1st argument}}
-// expected-note@+1 {{candidate function not viable: no known conversion from 'void (Variadic::A::*)(int, ...) __attribute__((cdecl))' to 'Variadic::memb_c_cdecl' (aka 'void (Variadic::C::*)(int, ...) __attribute__((cdecl))') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (Variadic::A::*)(int, ...)' to 'memb_c_cdecl' (aka 'void (Variadic::C::*)(int, ...) __attribute__((cdecl))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (Variadic::A::*)(int, ...) __attribute__((cdecl))' to 'memb_c_cdecl' (aka 'void (Variadic::C::*)(int, ...) __attribute__((cdecl))') for 1st argument}}
void cb_memb_c_cdecl(memb_c_cdecl ptr);
void call_member() {
void (A::*(*return_fptr_std_mptr(char))(short))(int) {
return return_mptr_std;
#if !_M_X64
- // expected-error@-2 {{cannot initialize return object of type 'void (MultiChunkDecls::A::*(*)(short))(int) __attribute__((thiscall))' with an lvalue of type 'MultiChunkDecls::mptr_t (short) __attribute__((stdcall))'}}
+ // expected-error@-2 {{cannot initialize return object of type 'void (MultiChunkDecls::A::*(*)(short))(int) __attribute__((thiscall))' with an lvalue of type 'mptr_t (short) __attribute__((stdcall))'}}
#endif
}
A() : decltype(Base(1))(3) {
}
A(int) : Base(3), // expected-note {{previous initialization is here}}
- decltype(Base(1))(2), // expected-error {{multiple initializations given for base 'decltype(test5::Base(1))' (aka 'test5::Base')}}
+ decltype(Base(1))(2), // expected-error {{multiple initializations given for base 'decltype(Base(1))' (aka 'test5::Base')}}
decltype(int())() { // expected-error {{constructor initializer 'decltype(int())' (aka 'int') does not name a class}}
}
A(float) : decltype(A())(3) {
// expected-warning@-2 {{default member initializer for non-static data member is a C++11 extension}}
#endif
static int si = 0; // expected-error {{non-const static data member must be initialized out of line}}
- static const NestedC ci = 0; // expected-error {{static data member of type 'const C::NestedC' must be initialized out of line}}
+ static const NestedC ci = 0; // expected-error {{static data member of type 'const NestedC' must be initialized out of line}}
static const int nci = vs; // expected-error {{in-class initializer for static data member is not a constant expression}}
static const int vi = 0;
static const volatile int cvi = 0; // ok, illegal in C++11
// CHECK: |-CompoundStmt {{.*}}
// CHECK: | `-ExprWithCleanups {{.*}} 'void'
// CHECK: | `-CoawaitExpr {{.*}} 'void'
-// CHECK: | |-CXXTemporaryObjectExpr {{.*}} 'executor' 'void (){{.*}} noexcept' zeroing
-// CHECK: | |-MaterializeTemporaryExpr {{.*}} 'awaitable_frame::result_t' lvalue
-// CHECK: | | `-CXXBindTemporaryExpr {{.*}} 'awaitable_frame::result_t' (CXXTemporary {{.*}})
-// CHECK: | | `-CXXMemberCallExpr {{.*}} 'awaitable_frame::result_t'
+// CHECK: | |-CXXTemporaryObjectExpr {{.*}} 'executor':'executor' 'void (){{.*}} noexcept' zeroing
+// CHECK: | |-MaterializeTemporaryExpr {{.*}} 'result_t':'awaitable_frame::result_t' lvalue
+// CHECK: | | `-CXXBindTemporaryExpr {{.*}} 'result_t':'awaitable_frame::result_t' (CXXTemporary {{.*}})
+// CHECK: | | `-CXXMemberCallExpr {{.*}} 'result_t':'awaitable_frame::result_t'
// CHECK: | | |-MemberExpr {{.*}} '<bound member function type>' .await_transform {{.*}}
// CHECK: | | | `-DeclRefExpr {{.*}} 'std::coroutine_traits<awaitable>::promise_type':'awaitable_frame' lvalue Var {{.*}} '__promise' 'std::coroutine_traits<awaitable>::promise_type':'awaitable_frame'
-// CHECK: | | `-CXXTemporaryObjectExpr {{.*}} 'executor' 'void (){{.*}} noexcept' zeroing
+// CHECK: | | `-CXXTemporaryObjectExpr {{.*}} 'executor':'executor' 'void (){{.*}} noexcept' zeroing
// CHECK: | |-ExprWithCleanups {{.*}} 'bool'
// CHECK: | | `-CXXMemberCallExpr {{.*}} 'bool'
// CHECK: | | `-MemberExpr {{.*}} '<bound member function type>' .await_ready {{.*}}
// CHECK: | | `-ImplicitCastExpr {{.*}} 'const awaitable_frame::result_t' lvalue <NoOp>
-// CHECK: | | `-OpaqueValueExpr {{.*}} 'awaitable_frame::result_t' lvalue
-// CHECK: | | `-MaterializeTemporaryExpr {{.*}} 'awaitable_frame::result_t' lvalue
-// CHECK: | | `-CXXBindTemporaryExpr {{.*}} 'awaitable_frame::result_t' (CXXTemporary {{.*}})
-// CHECK: | | `-CXXMemberCallExpr {{.*}} 'awaitable_frame::result_t'
+// CHECK: | | `-OpaqueValueExpr {{.*}} 'result_t':'awaitable_frame::result_t' lvalue
+// CHECK: | | `-MaterializeTemporaryExpr {{.*}} 'result_t':'awaitable_frame::result_t' lvalue
+// CHECK: | | `-CXXBindTemporaryExpr {{.*}} 'result_t':'awaitable_frame::result_t' (CXXTemporary {{.*}})
+// CHECK: | | `-CXXMemberCallExpr {{.*}} 'result_t':'awaitable_frame::result_t'
// CHECK: | | |-MemberExpr {{.*}} '<bound member function type>' .await_transform {{.*}}
// CHECK: | | | `-DeclRefExpr {{.*}} 'std::coroutine_traits<awaitable>::promise_type':'awaitable_frame' lvalue Var {{.*}} '__promise' 'std::coroutine_traits<awaitable>::promise_type':'awaitable_frame'
-// CHECK: | | `-CXXTemporaryObjectExpr {{.*}} 'executor' 'void (){{.*}} noexcept' zeroing
+// CHECK: | | `-CXXTemporaryObjectExpr {{.*}} 'executor':'executor' 'void (){{.*}} noexcept' zeroing
// CHECK: | |-ExprWithCleanups {{.*}} 'void'
// CHECK: | | `-CXXMemberCallExpr {{.*}} 'void'
// CHECK: | | |-MemberExpr {{.*}} '<bound member function type>' .await_suspend {{.*}}
-// CHECK: | | | `-OpaqueValueExpr {{.*}} 'awaitable_frame::result_t' lvalue
-// CHECK: | | | `-MaterializeTemporaryExpr {{.*}} 'awaitable_frame::result_t' lvalue
-// CHECK: | | | `-CXXBindTemporaryExpr {{.*}} 'awaitable_frame::result_t' (CXXTemporary {{.*}})
-// CHECK: | | | `-CXXMemberCallExpr {{.*}} 'awaitable_frame::result_t'
+// CHECK: | | | `-OpaqueValueExpr {{.*}} 'result_t':'awaitable_frame::result_t' lvalue
+// CHECK: | | | `-MaterializeTemporaryExpr {{.*}} 'result_t':'awaitable_frame::result_t' lvalue
+// CHECK: | | | `-CXXBindTemporaryExpr {{.*}} 'result_t':'awaitable_frame::result_t' (CXXTemporary {{.*}})
+// CHECK: | | | `-CXXMemberCallExpr {{.*}} 'result_t':'awaitable_frame::result_t'
// CHECK: | | | |-MemberExpr {{.*}} '<bound member function type>' .await_transform {{.*}}
// CHECK: | | | | `-DeclRefExpr {{.*}} 'std::coroutine_traits<awaitable>::promise_type':'awaitable_frame' lvalue Var {{.*}} '__promise' 'std::coroutine_traits<awaitable>::promise_type':'awaitable_frame'
-// CHECK: | | | `-CXXTemporaryObjectExpr {{.*}} 'executor' 'void (){{.*}} noexcept' zeroing
+// CHECK: | | | `-CXXTemporaryObjectExpr {{.*}} 'executor':'executor' 'void (){{.*}} noexcept' zeroing
// CHECK: | | `-ImplicitCastExpr {{.*}} 'std::coroutine_handle<void>':'std::coroutine_handle<void>' <ConstructorConversion>
// CHECK: | | `-CXXConstructExpr {{.*}} 'std::coroutine_handle<void>':'std::coroutine_handle<void>' 'void (coroutine_handle<awaitable_frame> &&){{.*}} noexcept'
-// CHECK: | | `-MaterializeTemporaryExpr {{.*}} 'std::coroutine_handle<awaitable_frame>' xvalue
-// CHECK: | | `-CallExpr {{.*}} 'std::coroutine_handle<awaitable_frame>'
-// CHECK: | | |-ImplicitCastExpr {{.*}} 'std::coroutine_handle<awaitable_frame> (*)(void *) noexcept' <FunctionToPointerDecay>
-// CHECK: | | | `-DeclRefExpr {{.*}} 'std::coroutine_handle<awaitable_frame> (void *) noexcept' lvalue CXXMethod {{.*}} 'from_address' 'std::coroutine_handle<awaitable_frame> (void *) noexcept'
+// CHECK: | | `-MaterializeTemporaryExpr {{.*}} 'coroutine_handle<awaitable_frame>':'std::coroutine_handle<awaitable_frame>' xvalue
+// CHECK: | | `-CallExpr {{.*}} 'coroutine_handle<awaitable_frame>':'std::coroutine_handle<awaitable_frame>'
+// CHECK: | | |-ImplicitCastExpr {{.*}} 'coroutine_handle<awaitable_frame> (*)(void *) noexcept' <FunctionToPointerDecay>
+// CHECK: | | | `-DeclRefExpr {{.*}} 'coroutine_handle<awaitable_frame> (void *) noexcept' lvalue CXXMethod {{.*}} 'from_address' 'coroutine_handle<awaitable_frame> (void *) noexcept'
// CHECK: | | `-CallExpr {{.*}} 'void *'
// CHECK: | | `-ImplicitCastExpr {{.*}} 'void *(*)() noexcept' <FunctionToPointerDecay>
// CHECK: | | `-DeclRefExpr {{.*}} 'void *() noexcept' lvalue Function {{.*}} '__builtin_coro_frame' 'void *() noexcept'
// CHECK: | `-CXXMemberCallExpr {{.*}} 'void'
// CHECK: | `-MemberExpr {{.*}} '<bound member function type>' .await_resume {{.*}}
// CHECK: | `-ImplicitCastExpr {{.*}} 'const awaitable_frame::result_t' lvalue <NoOp>
-// CHECK: | `-OpaqueValueExpr {{.*}} 'awaitable_frame::result_t' lvalue
-// CHECK: | `-MaterializeTemporaryExpr {{.*}} 'awaitable_frame::result_t' lvalue
-// CHECK: | `-CXXBindTemporaryExpr {{.*}} 'awaitable_frame::result_t' (CXXTemporary {{.*}})
-// CHECK: | `-CXXMemberCallExpr {{.*}} 'awaitable_frame::result_t'
+// CHECK: | `-OpaqueValueExpr {{.*}} 'result_t':'awaitable_frame::result_t' lvalue
+// CHECK: | `-MaterializeTemporaryExpr {{.*}} 'result_t':'awaitable_frame::result_t' lvalue
+// CHECK: | `-CXXBindTemporaryExpr {{.*}} 'result_t':'awaitable_frame::result_t' (CXXTemporary {{.*}})
+// CHECK: | `-CXXMemberCallExpr {{.*}} 'result_t':'awaitable_frame::result_t'
// CHECK: | |-MemberExpr {{.*}} '<bound member function type>' .await_transform {{.*}}
// CHECK: | | `-DeclRefExpr {{.*}} 'std::coroutine_traits<awaitable>::promise_type':'awaitable_frame' lvalue Var {{.*}} '__promise' 'std::coroutine_traits<awaitable>::promise_type':'awaitable_frame'
-// CHECK: | `-CXXTemporaryObjectExpr {{.*}} <col:12, col:21> 'executor' 'void (){{.*}} noexcept' zeroing
+// CHECK: | `-CXXTemporaryObjectExpr {{.*}} <col:12, col:21> 'executor':'executor' 'void (){{.*}} noexcept' zeroing
// Rest of the generated coroutine statements omitted.
\r
POD p = (POD){1, 2};\r
// CHECK-NOT: CXXBindTemporaryExpr {{.*}} 'brace_initializers::POD'\r
- // CHECK: CompoundLiteralExpr {{.*}} 'brace_initializers::POD'\r
- // CHECK-NEXT: InitListExpr {{.*}} 'brace_initializers::POD'\r
+ // CHECK: CompoundLiteralExpr {{.*}} 'POD':'brace_initializers::POD'\r
+ // CHECK-NEXT: InitListExpr {{.*}} 'POD':'brace_initializers::POD'\r
// CHECK-NEXT: ConstantExpr {{.*}}\r
// CHECK-NEXT: IntegerLiteral {{.*}} 1{{$}}\r
// CHECK-NEXT: ConstantExpr {{.*}}\r
\r
void test() {\r
(void)(POD){1, 2};\r
- // CHECK-NOT: CXXBindTemporaryExpr {{.*}} 'brace_initializers::POD'\r
- // CHECK-NOT: ConstantExpr {{.*}} 'brace_initializers::POD'\r
- // CHECK: CompoundLiteralExpr {{.*}} 'brace_initializers::POD'\r
- // CHECK-NEXT: InitListExpr {{.*}} 'brace_initializers::POD'\r
+ // CHECK-NOT: CXXBindTemporaryExpr {{.*}} 'POD':'brace_initializers::POD'\r
+ // CHECK-NOT: ConstantExpr {{.*}} 'POD':'brace_initializers::POD'\r
+ // CHECK: CompoundLiteralExpr {{.*}} 'POD':'brace_initializers::POD'\r
+ // CHECK-NEXT: InitListExpr {{.*}} 'POD':'brace_initializers::POD'\r
// CHECK-NEXT: IntegerLiteral {{.*}} 1{{$}}\r
// CHECK-NEXT: IntegerLiteral {{.*}} 2{{$}}\r
\r
(void)(HasDtor){1, 2};\r
- // CHECK: CXXBindTemporaryExpr {{.*}} 'brace_initializers::HasDtor'\r
- // CHECK-NEXT: CompoundLiteralExpr {{.*}} 'brace_initializers::HasDtor'\r
- // CHECK-NEXT: InitListExpr {{.*}} 'brace_initializers::HasDtor'\r
+ // CHECK: CXXBindTemporaryExpr {{.*}} 'HasDtor':'brace_initializers::HasDtor'\r
+ // CHECK-NEXT: CompoundLiteralExpr {{.*}} 'HasDtor':'brace_initializers::HasDtor'\r
+ // CHECK-NEXT: InitListExpr {{.*}} 'HasDtor':'brace_initializers::HasDtor'\r
// CHECK-NEXT: IntegerLiteral {{.*}} 1{{$}}\r
// CHECK-NEXT: IntegerLiteral {{.*}} 2{{$}}\r
\r
#if __cplusplus >= 201103L\r
(void)(HasCtor){1, 2};\r
- // CHECK-CXX11-NOT: CXXBindTemporaryExpr {{.*}} 'brace_initializers::HasCtor'\r
- // CHECK-CXX11-NOT: ConstantExpr {{.*}} 'brace_initializers::HasCtor'\r
- // CHECK-CXX11: CompoundLiteralExpr {{.*}} 'brace_initializers::HasCtor'\r
- // CHECK-CXX11-NEXT: CXXTemporaryObjectExpr {{.*}} 'brace_initializers::HasCtor'\r
+ // CHECK-CXX11-NOT: CXXBindTemporaryExpr {{.*}} 'HasCtor':'brace_initializers::HasCtor'\r
+ // CHECK-CXX11-NOT: ConstantExpr {{.*}} 'HasCtor':'brace_initializers::HasCtor'\r
+ // CHECK-CXX11: CompoundLiteralExpr {{.*}} 'HasCtor':'brace_initializers::HasCtor'\r
+ // CHECK-CXX11-NEXT: CXXTemporaryObjectExpr {{.*}} 'HasCtor':'brace_initializers::HasCtor'\r
// CHECK-CXX11-NEXT: IntegerLiteral {{.*}} 1{{$}}\r
// CHECK-CXX11-NEXT: IntegerLiteral {{.*}} 2{{$}}\r
\r
(void)(HasCtorDtor){1, 2};\r
- // CHECK-CXX11: CXXBindTemporaryExpr {{.*}} 'brace_initializers::HasCtorDtor'\r
- // CHECK-CXX11-NOT: ConstantExpr {{.*}} 'brace_initializers::HasCtorDtor'\r
- // CHECK-CXX11: CompoundLiteralExpr {{.*}} 'brace_initializers::HasCtorDtor'\r
- // CHECK-CXX11-NEXT: CXXTemporaryObjectExpr {{.*}} 'brace_initializers::HasCtorDtor'\r
+ // CHECK-CXX11: CXXBindTemporaryExpr {{.*}} 'HasCtorDtor':'brace_initializers::HasCtorDtor'\r
+ // CHECK-CXX11-NOT: ConstantExpr {{.*}} 'HasCtorDtor':'brace_initializers::HasCtorDtor'\r
+ // CHECK-CXX11: CompoundLiteralExpr {{.*}} 'HasCtorDtor':'brace_initializers::HasCtorDtor'\r
+ // CHECK-CXX11-NEXT: CXXTemporaryObjectExpr {{.*}} 'HasCtorDtor':'brace_initializers::HasCtorDtor'\r
// CHECK-CXX11-NEXT: IntegerLiteral {{.*}} 1{{$}}\r
// CHECK-CXX11-NEXT: IntegerLiteral {{.*}} 2{{$}}\r
#endif\r
};\r
\r
void testPrivateDtor() {\r
- (void)(PrivateDtor){1, 2}; // expected-error {{temporary of type 'brace_initializers::PrivateDtor' has private destructor}}\r
+ (void)(PrivateDtor){1, 2}; // expected-error {{temporary of type 'PrivateDtor' has private destructor}}\r
}\r
}\r
\r
static_assert(pb1 == &bot1, "");
static_assert(pb2 == &bot2, "");
-constexpr Base2 &fail = (Base2&)bot1; // expected-error {{constant expression}} expected-note {{cannot cast object of dynamic type 'const Class::Derived' to type 'Class::Base2'}}
-constexpr Base &fail2 = (Base&)*pb2; // expected-error {{constant expression}} expected-note {{cannot cast object of dynamic type 'const Class::Derived' to type 'Class::Base'}}
+constexpr Base2 &fail = (Base2&)bot1; // expected-error {{constant expression}} expected-note {{cannot cast object of dynamic type 'const Derived' to type 'Base2'}}
+constexpr Base &fail2 = (Base&)*pb2; // expected-error {{constant expression}} expected-note {{cannot cast object of dynamic type 'const Derived' to type 'Base'}}
constexpr Base2 &ok2 = (Base2&)bot2;
static_assert(&ok2 == &derived, "");
-constexpr Base2 *pfail = (Base2*)pb1; // expected-error {{constant expression}} expected-note {{cannot cast object of dynamic type 'const Class::Derived' to type 'Class::Base2'}}
-constexpr Base *pfail2 = (Base*)&bot2; // expected-error {{constant expression}} expected-note {{cannot cast object of dynamic type 'const Class::Derived' to type 'Class::Base'}}
+constexpr Base2 *pfail = (Base2*)pb1; // expected-error {{constant expression}} expected-note {{cannot cast object of dynamic type 'const Derived' to type 'Base2'}}
+constexpr Base *pfail2 = (Base*)&bot2; // expected-error {{constant expression}} expected-note {{cannot cast object of dynamic type 'const Derived' to type 'Base'}}
constexpr Base2 *pok2 = (Base2*)pb2;
static_assert(pok2 == &derived, "");
static_assert(&ok2 == pok2, "");
// Core issue 903: we do not perform constant evaluation when checking for a
// null pointer in C++11. Just check for an integer literal with value 0.
-constexpr Base *nullB = 42 - 6 * 7; // expected-error {{cannot initialize a variable of type 'Class::Base *const' with an rvalue of type 'int'}}
+constexpr Base *nullB = 42 - 6 * 7; // expected-error {{cannot initialize a variable of type 'Base *const' with an rvalue of type 'int'}}
constexpr Base *nullB1 = 0;
static_assert((Bottom*)nullB == 0, "");
static_assert((Derived*)nullB1 == 0, "");
static_assert((void*)(Bottom*)nullB1 == (void*)(Derived*)nullB1, "");
-Base *nullB2 = '\0'; // expected-error {{cannot initialize a variable of type 'Class::Base *' with an rvalue of type 'char'}}
+Base *nullB2 = '\0'; // expected-error {{cannot initialize a variable of type 'Base *' with an rvalue of type 'char'}}
Base *nullB3 = (0);
-Base *nullB4 = false; // expected-error {{cannot initialize a variable of type 'Class::Base *' with an rvalue of type 'bool'}}
+Base *nullB4 = false; // expected-error {{cannot initialize a variable of type 'Base *' with an rvalue of type 'bool'}}
Base *nullB5 = ((0ULL));
-Base *nullB6 = 0.; // expected-error {{cannot initialize a variable of type 'Class::Base *' with an rvalue of type 'double'}}
+Base *nullB6 = 0.; // expected-error {{cannot initialize a variable of type 'Base *' with an rvalue of type 'double'}}
enum Null { kNull };
-Base *nullB7 = kNull; // expected-error {{cannot initialize a variable of type 'Class::Base *' with an rvalue of type 'Class::Null'}}
+Base *nullB7 = kNull; // expected-error {{cannot initialize a variable of type 'Base *' with an rvalue of type 'Class::Null'}}
static_assert(nullB1 == (1 - 1), ""); // expected-error {{comparison between pointer and integer}}
// The T temporary is implicitly cast to an S subobject, but we can recover the
// T full-object via a base-to-derived cast, or a derived-to-base-casted member
// pointer.
-static_assert(S().f(), ""); // expected-error {{constant expression}} expected-note {{in call to '&Temporaries::S()->f()'}}
-static_assert(S().g(), ""); // expected-error {{constant expression}} expected-note {{in call to '&Temporaries::S()->g()'}}
+static_assert(S().f(), ""); // expected-error {{constant expression}} expected-note {{in call to '&S()->f()'}}
+static_assert(S().g(), ""); // expected-error {{constant expression}} expected-note {{in call to '&S()->g()'}}
static_assert(T(3).f() == 3, "");
static_assert(T(4).g() == 4, "");
NonLiteral();
int f();
};
-constexpr int k = NonLiteral().f(); // expected-error {{constant expression}} expected-note {{non-literal type 'Temporaries::NonLiteral'}}
+constexpr int k = NonLiteral().f(); // expected-error {{constant expression}} expected-note {{non-literal type 'NonLiteral'}}
}
namespace PR11595 {
struct A { constexpr bool operator==(int x) const { return true; } };
struct B { B(); A& x; };
- static_assert(B().x == 3, ""); // expected-error {{constant expression}} expected-note {{non-literal type 'PR11595::B' cannot be used in a constant expression}}
+ static_assert(B().x == 3, ""); // expected-error {{constant expression}} expected-note {{non-literal type 'B' cannot be used in a constant expression}}
constexpr bool f(int k) { // expected-error {{constexpr function never produces a constant expression}}
- return B().x == k; // expected-note {{non-literal type 'PR11595::B' cannot be used in a constant expression}}
+ return B().x == k; // expected-note {{non-literal type 'B' cannot be used in a constant expression}}
}
}
A &g(); // cxx20_2b-note {{declared here}}
constexpr auto &x = typeid(f());
constexpr auto &y = typeid(g()); // expected-error{{constant expression}}
- // cxx11-note@-1 {{typeid applied to expression of polymorphic type 'TypeId::A' is not allowed in a constant expression}}
+ // cxx11-note@-1 {{typeid applied to expression of polymorphic type 'A' is not allowed in a constant expression}}
// expected-warning@-2 {{expression with side effects will be evaluated despite being used as an operand to 'typeid'}}
// cxx20_2b-note@-3 {{non-constexpr function 'g' cannot be used in a constant expression}}
}
};
constexpr X() noexcept {};
protected:
- E val{0}; // cxx11-error {{cannot initialize a member subobject of type 'ConstexprConstructorRecovery::X::E' with an rvalue of type 'int'}} cxx11-note {{here}}
+ E val{0}; // cxx11-error {{cannot initialize a member subobject of type 'E' with an rvalue of type 'int'}} cxx11-note {{here}}
};
// FIXME: We should avoid issuing this follow-on diagnostic.
constexpr X x{}; // cxx11-error {{constant expression}} cxx11-note {{not initialized}}
static_assert(g.f == (void*)(F*)&g);
static_assert(dynamic_cast<const void*>(static_cast<const D*>(&g)) == &g);
- // expected-note@+1 {{reference dynamic_cast failed: 'DynamicCast::A' is an ambiguous base class of dynamic type 'DynamicCast::G' of operand}}
+ // expected-note@+1 {{reference dynamic_cast failed: 'A' is an ambiguous base class of dynamic type 'DynamicCast::G' of operand}}
constexpr int d_a = (dynamic_cast<const A&>(static_cast<const D&>(g)), 0); // expected-error {{}}
// Can navigate from A2 to its A...
// ... and from B to its A ...
static_assert(&dynamic_cast<A&>((B&)g) == &(A&)(B&)g);
// ... but not from D.
- // expected-note@+1 {{reference dynamic_cast failed: 'DynamicCast::A' is an ambiguous base class of dynamic type 'DynamicCast::G' of operand}}
+ // expected-note@+1 {{reference dynamic_cast failed: 'A' is an ambiguous base class of dynamic type 'DynamicCast::G' of operand}}
static_assert(&dynamic_cast<A&>((D&)g) == &(A&)(B&)g); // expected-error {{}}
// Can cast from A2 to sibling class D.
constexpr int e_f = (dynamic_cast<F&>((E&)g), 0); // expected-error {{}}
// Cannot cast from B to private sibling E.
- // expected-note@+1 {{reference dynamic_cast failed: 'DynamicCast::E' is a non-public base class of dynamic type 'DynamicCast::G' of operand}}
+ // expected-note@+1 {{reference dynamic_cast failed: 'E' is a non-public base class of dynamic type 'DynamicCast::G' of operand}}
constexpr int b_e = (dynamic_cast<E&>((B&)g), 0); // expected-error {{}}
struct Unrelated { virtual void unrelated(); };
- // expected-note@+1 {{reference dynamic_cast failed: dynamic type 'DynamicCast::G' of operand does not have a base class of type 'DynamicCast::Unrelated'}}
+ // expected-note@+1 {{reference dynamic_cast failed: dynamic type 'DynamicCast::G' of operand does not have a base class of type 'Unrelated'}}
constexpr int b_unrelated = (dynamic_cast<Unrelated&>((B&)g), 0); // expected-error {{}}
- // expected-note@+1 {{reference dynamic_cast failed: dynamic type 'DynamicCast::G' of operand does not have a base class of type 'DynamicCast::Unrelated'}}
+ // expected-note@+1 {{reference dynamic_cast failed: dynamic type 'DynamicCast::G' of operand does not have a base class of type 'Unrelated'}}
constexpr int e_unrelated = (dynamic_cast<Unrelated&>((E&)g), 0); // expected-error {{}}
}
int n; // expected-note {{declared here}}
static_assert((delete &n, true)); // expected-error {{}} expected-note {{delete of pointer '&n' that does not point to a heap-allocated object}}
struct A { int n; };
- static_assert((delete &(new A)->n, true)); // expected-error {{}} expected-note {{delete of pointer to subobject '&{*new delete_random_things::A#0}.n'}}
+ static_assert((delete &(new A)->n, true)); // expected-error {{}} expected-note {{delete of pointer to subobject '&{*new A#0}.n'}}
static_assert((delete (new int + 1), true)); // expected-error {{}} expected-note {{delete of pointer '&{*new int#0} + 1' that does not point to complete object}}
static_assert((delete[] (new int[3] + 1), true)); // expected-error {{}} expected-note {{delete of pointer to subobject '&{*new int[3]#0}[1]'}}
static_assert((delete &(int&)(int&&)0, true)); // expected-error {{}} expected-note {{delete of pointer '&0' that does not point to a heap-allocated object}} expected-note {{temporary created here}}
// PR12626
namespace test3 {
struct X; // expected-note {{forward declaration of 'test3::X'}}
- struct Y { bool b; X x; }; // expected-error {{field has incomplete type 'test3::X'}}
+ struct Y { bool b; X x; }; // expected-error {{field has incomplete type 'X'}}
int f() { return Y().b; }
}
};
constexpr Foo getFoo() {
- Foo e = 123; // expected-error {{no viable conversion from 'int' to 'NoCrash::Foo'}}
+ Foo e = 123; // expected-error {{no viable conversion from 'int' to 'Foo'}}
return e;
}
}
D() : B(), C() { }
};
-class E : public D, public B { // expected-warning{{direct base 'B' is inaccessible due to ambiguity:\n class E -> class D -> class C -> class B\n class E -> class B}}
+class E : public D, public B { // expected-warning{{direct base 'B' is inaccessible due to ambiguity:\n class E -> D -> C -> B\n class E -> B}}
public:
E() : B(), D() { } // expected-error{{base class initializer 'B' names both a direct base class and an inherited virtual base class}}
};
struct B : virtual A { };
- struct C : A, B { }; // expected-warning{{direct base 'Test2::A' is inaccessible due to ambiguity:\n struct Test2::C -> struct Test2::A\n struct Test2::C -> struct Test2::B -> struct Test2::A}}
+ struct C : A, B { }; // expected-warning{{direct base 'A' is inaccessible due to ambiguity:\n struct Test2::C -> A\n struct Test2::C -> B -> A}}
C f(C c) {
return c;
namespace PR10758 {
struct A;
struct B {
- B (A const &); // expected-note 2 {{candidate constructor not viable: no known conversion from 'const PR10758::B' to 'const PR10758::A &' for 1st argument}}
- B (B &); // expected-note 2 {{candidate constructor not viable: 1st argument ('const PR10758::B') would lose const qualifier}}
+ B (A const &); // expected-note 2 {{candidate constructor not viable: no known conversion from 'const B' to 'const A &' for 1st argument}}
+ B (B &); // expected-note 2 {{candidate constructor not viable: 1st argument ('const B') would lose const qualifier}}
};
struct A {
A (B); // expected-note 2 {{passing argument to parameter here}}
};
B f(B const &b) {
- return b; // expected-error {{no matching constructor for initialization of 'PR10758::B'}}
+ return b; // expected-error {{no matching constructor for initialization of 'B'}}
}
A f2(const B &b) {
- return b; // expected-error {{no matching constructor for initialization of 'PR10758::B'}}
+ return b; // expected-error {{no matching constructor for initialization of 'B'}}
}
}
Y make_Y();
X f() {
- X x = make_Y(); // expected-error{{no viable conversion from 'smart_ptr::Y' to 'smart_ptr::X'}}
+ X x = make_Y(); // expected-error{{no viable conversion from 'Y' to 'X'}}
X x2(make_Y());
return X(Y());
}
};
void test2(UeberDerived ud) {
- int i = ud; // expected-error{{ambiguous conversion from derived class 'rdar8018274::UeberDerived' to base class 'rdar8018274::Base'}}
+ int i = ud; // expected-error{{ambiguous conversion from derived class 'UeberDerived' to base class 'rdar8018274::Base'}}
}
struct Base2 {
void f(Foo);
void g(Foo foo) {
- f(Bar()); // expected-error{{no viable constructor copying parameter of type 'const PR6757::Foo'}}
+ f(Bar()); // expected-error{{no viable constructor copying parameter of type 'const Foo'}}
f(foo);
}
}
(void)(C1&)(*((A*)0)); // expected-error {{cannot cast 'A' to 'C1 &' via virtual base 'B'}}
(void)(D*)((A*)0); // expected-error {{cannot cast 'A *' to 'D *' via virtual base 'B'}}
(void)(D&)(*((A*)0)); // expected-error {{cannot cast 'A' to 'D &' via virtual base 'B'}}
- (void)(H*)((A*)0); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n struct A -> struct B -> struct G1 -> struct H\n struct A -> struct B -> struct G2 -> struct H}}
- (void)(H&)(*((A*)0)); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n struct A -> struct B -> struct G1 -> struct H\n struct A -> struct B -> struct G2 -> struct H}}
+ (void)(H*)((A*)0); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n A -> B -> G1 -> struct H\n A -> B -> G2 -> struct H}}
+ (void)(H&)(*((A*)0)); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n A -> B -> G1 -> struct H\n A -> B -> G2 -> struct H}}
// TODO: Test DR427. This requires user-defined conversions, though.
}
int i = 0;
static int si = 0; // expected-error {{non-const static data member must be initialized out of line}}
- static const NestedC ci = 0; // expected-error {{static data member of type 'const C::NestedC' must be initialized out of line}}
+ static const NestedC ci = 0; // expected-error {{static data member of type 'const NestedC' must be initialized out of line}}
static const int nci = vs; // expected-error {{in-class initializer for static data member is not a constant expression}}
static const int vi = 0;
static const volatile int cvi = 0; // expected-error {{static const volatile data member must be initialized out of line}}
namespace array_addressof {
using T = int[5];
- T *p = &T{1,2,3,4,5}; // expected-error {{taking the address of a temporary object of type 'array_addressof::T' (aka 'int[5]')}}
+ T *p = &T{1,2,3,4,5}; // expected-error {{taking the address of a temporary object of type 'T' (aka 'int[5]')}}
}
namespace PR24816 {
}
struct B { // expected-note 2 {{candidate constructor}}
- B(C, int, C); // expected-note {{candidate constructor not viable: cannot convert initializer list argument to 'objects::C'}}
+ B(C, int, C); // expected-note {{candidate constructor not viable: cannot convert initializer list argument to 'C'}}
};
void nested_init() {
B b1{{1, 1.0}, 2, {3, 4}};
- B b2{{1, 1.0, 4}, 2, {3, 4}}; // expected-error {{no matching constructor for initialization of 'objects::B'}}
+ B b2{{1, 1.0, 4}, 2, {3, 4}}; // expected-error {{no matching constructor for initialization of 'B'}}
}
void overloaded_call() {
static void bar(C* c)
{
- c->foo({ nullptr, 1 }); // expected-error{{initialization of incomplete type 'const PR12498::ArrayRef'}}
+ c->foo({ nullptr, 1 }); // expected-error{{initialization of incomplete type 'const ArrayRef'}}
}
}
void edge_cases() {
int const &b({0}); // expected-error {{cannot initialize reference type 'const int &' with a parenthesized initializer list}}
const int (&arr)[3] ({1, 2, 3}); // expected-error {{cannot initialize reference type 'const int (&)[3]' with a parenthesized initializer list}}
- const X &x({}); // expected-error {{cannot initialize reference type 'const reference::X &' with a parenthesized initializer list}}
+ const X &x({}); // expected-error {{cannot initialize reference type 'const X &' with a parenthesized initializer list}}
}
template<typename T> void dependent_edge_cases() {
namespace inner_init {
struct A { int n; };
struct B { A &&r; };
- B b1 { 0 }; // expected-error {{reference to type 'inner_init::A' could not bind to an rvalue of type 'int'}}
+ B b1 { 0 }; // expected-error {{reference to type 'A' could not bind to an rvalue of type 'int'}}
B b2 { { 0 } };
B b3 { { { 0 } } }; // expected-warning {{braces around scalar init}}
D d1 { 0 }; // ok, 0 implicitly converts to C
D d2 { { 0 } }; // ok, { 0 } calls C(0)
D d3 { { { 0 } } }; // ok, { { 0 } } calls C({ 0 }), expected-warning {{braces around scalar init}}
- D d4 { { { { 0 } } } }; // expected-error {{no matching constructor for initialization of 'inner_init::C &&'}}
+ D d4 { { { { 0 } } } }; // expected-error {{no matching constructor for initialization of 'C &&'}}
struct E { explicit E(int); }; // expected-note 2{{here}}
struct F { E &&r; };
namespace PR20844 {
struct A {};
struct B { operator A&(); } b;
- A &a{b}; // expected-error {{excess elements}} expected-note {{in initialization of temporary of type 'PR20844::A'}}
+ A &a{b}; // expected-error {{excess elements}} expected-note {{in initialization of temporary of type 'A'}}
}
namespace PR21834 {
struct A {};
template <typename T, typename F, int... I>
std::initializer_list<T> ExplodeImpl(F p1, A<int, I...>) {
- // expected-error@+1 {{reference to incomplete type 'const update_rbrace_loc_crash::Incomplete' could not bind to an rvalue of type 'void'}}
+ // expected-error@+1 {{reference to incomplete type 'const Incomplete' could not bind to an rvalue of type 'void'}}
return {p1(I)...};
}
template <typename T, int N, typename F>
};
};
- Test2<X> t2x; // expected-error {{call to implicitly-deleted default constructor of 'Test2<pr16061::X>'}}
+ Test2<X> t2x; // expected-error {{call to implicitly-deleted default constructor of 'Test2<X>'}}
}
struct A : Base {
using Base::Base;
- bool operator==(A const &) const; // expected-note {{no known conversion from 'PR31606::B' to 'const PR31606::A' for 1st argument}}
+ bool operator==(A const &) const; // expected-note {{no known conversion from 'B' to 'const A' for 1st argument}}
};
struct B : Base {
struct A {};
template<A> struct Class {};
#if __cplusplus <= 201703L
- // expected-error@-2 {{non-type template parameter cannot have type 'NTTP::A' before C++20}}
+ // expected-error@-2 {{non-type template parameter cannot have type 'A' before C++20}}
#else
- // expected-warning@-4 {{non-type template parameter of type 'NTTP::A' is incompatible with C++ standards before C++20}}
+ // expected-warning@-4 {{non-type template parameter of type 'A' is incompatible with C++ standards before C++20}}
#endif
}
//expected-error@71 {{cannot overload a member function without a ref-qualifier with a member function with ref-qualifier '&&'}}
//expected-note@70 {{previous declaration is here}}
-//expected-error@82 {{statement requires expression of integer type ('extended_examples::A2' invalid)}}
-//expected-error@83 {{statement requires expression of integer type ('extended_examples::A3' invalid)}}
-//expected-error@84 {{statement requires expression of integer type ('extended_examples::A4' invalid)}}
+//expected-error@82 {{statement requires expression of integer type ('A2' invalid)}}
+//expected-error@83 {{statement requires expression of integer type ('A3' invalid)}}
+//expected-error@84 {{statement requires expression of integer type ('A4' invalid)}}
#ifdef CXX1Y
-//expected-error@81 {{statement requires expression of integer type ('extended_examples::A1' invalid)}}
-//expected-error@85 {{statement requires expression of integer type ('extended_examples::B2' invalid)}}
+//expected-error@81 {{statement requires expression of integer type ('A1' invalid)}}
+//expected-error@85 {{statement requires expression of integer type ('B2' invalid)}}
#else
//expected-error@81 {{'this' argument to member function 'operator int' is an lvalue, but function has rvalue ref-qualifier}} expected-note@54 {{'operator int' declared here}}
//expected-error@85 {{'this' argument to member function 'operator int' is an lvalue, but function has rvalue ref-qualifier}} expected-note@75 {{'operator int' declared here}}
}
}
-//expected-error@142 {{statement requires expression of integer type ('extended_examples_cxx1y::C' invalid)}}
+//expected-error@142 {{statement requires expression of integer type ('C' invalid)}}
#ifdef CXX1Y
-//expected-error@139 {{statement requires expression of integer type ('extended_examples_cxx1y::A2' invalid)}}
+//expected-error@139 {{statement requires expression of integer type ('A2' invalid)}}
#else
//expected-error@138 {{'this' argument to member function 'operator int' is an lvalue, but function has rvalue ref-qualifier}} expected-note@106 {{'operator int' declared here}}
//expected-error@139 {{'this' argument to member function 'operator int' is an lvalue, but function has rvalue ref-qualifier}} expected-note@111 {{'operator int' declared here}}
};
struct B : private A { using A::operator delete; }; // expected-note 2{{declared private here}}
struct C : B {};
- void delete_C(C *c) { delete c; } // expected-error {{cannot cast 'convert_param::C' to its private base class 'convert_param::A'}}
+ void delete_C(C *c) { delete c; } // expected-error {{cannot cast 'C' to its private base class 'A'}}
- // expected-error@-7 {{cannot cast 'convert_param::D' to its private base class 'convert_param::A'}}
+ // expected-error@-7 {{cannot cast 'convert_param::D' to its private base class 'A'}}
struct D : B { virtual ~D() {} }; // expected-note {{while checking implicit 'delete this' for virtual destructor}}
}
struct D : B {};
struct E : C, D {};
void g(E *e) {
- delete e; // expected-error {{ambiguous conversion from derived class 'first_param_conversion::E' to base class 'first_param_conversion::B':}}
+ delete e; // expected-error {{ambiguous conversion from derived class 'E' to base class 'B':}}
}
}
Private p; // expected-note {{copy constructor of 'Deleted' is implicitly deleted because field 'p' has an inaccessible copy constructor}}
};
- const Private &a = Private(); // expected-warning {{copying variable of type 'CopyCtorIssues::Private' when binding a reference to a temporary would invoke an inaccessible constructor in C++98}}
- const NoViable &b = NoViable(); // expected-warning {{copying variable of type 'CopyCtorIssues::NoViable' when binding a reference to a temporary would find no viable constructor in C++98}}
- const Ambiguous &c = Ambiguous(); // expected-warning {{copying variable of type 'CopyCtorIssues::Ambiguous' when binding a reference to a temporary would find ambiguous constructors in C++98}}
- const Deleted &d = Deleted(); // expected-warning {{copying variable of type 'CopyCtorIssues::Deleted' when binding a reference to a temporary would invoke a deleted constructor in C++98}}
+ const Private &a = Private(); // expected-warning {{copying variable of type 'Private' when binding a reference to a temporary would invoke an inaccessible constructor in C++98}}
+ const NoViable &b = NoViable(); // expected-warning {{copying variable of type 'NoViable' when binding a reference to a temporary would find no viable constructor in C++98}}
+ const Ambiguous &c = Ambiguous(); // expected-warning {{copying variable of type 'Ambiguous' when binding a reference to a temporary would find ambiguous constructors in C++98}}
+ const Deleted &d = Deleted(); // expected-warning {{copying variable of type 'Deleted' when binding a reference to a temporary would invoke a deleted constructor in C++98}}
int n = 0b00100101001; // expected-warning {{binary integer literals are incompatible with C++ standards before C++14}}
}
Private p; // expected-note {{implicitly deleted}}
};
- const Private &a = Private(); // expected-warning {{copying variable of type 'CopyCtorIssues::Private' when binding a reference to a temporary would invoke an inaccessible constructor in C++98}}
- const NoViable &b = NoViable(); // expected-warning {{copying variable of type 'CopyCtorIssues::NoViable' when binding a reference to a temporary would find no viable constructor in C++98}}
+ const Private &a = Private(); // expected-warning {{copying variable of type 'Private' when binding a reference to a temporary would invoke an inaccessible constructor in C++98}}
+ const NoViable &b = NoViable(); // expected-warning {{copying variable of type 'NoViable' when binding a reference to a temporary would find no viable constructor in C++98}}
#if !CXX98
- const Ambiguous &c = Ambiguous(); // expected-warning {{copying variable of type 'CopyCtorIssues::Ambiguous' when binding a reference to a temporary would find ambiguous constructors in C++98}}
+ const Ambiguous &c = Ambiguous(); // expected-warning {{copying variable of type 'Ambiguous' when binding a reference to a temporary would find ambiguous constructors in C++98}}
#endif
- const Deleted &d = Deleted(); // expected-warning {{copying variable of type 'CopyCtorIssues::Deleted' when binding a reference to a temporary would invoke a deleted constructor in C++98}}
+ const Deleted &d = Deleted(); // expected-warning {{copying variable of type 'Deleted' when binding a reference to a temporary would invoke a deleted constructor in C++98}}
}
namespace IncompleteTest {
struct String;
- // expected-error@+1 {{reference to incomplete type 'const IncompleteTest::String' could not bind to an lvalue of type 'const char[1]'}}
+ // expected-error@+1 {{reference to incomplete type 'const String' could not bind to an lvalue of type 'const char[1]'}}
void takeString(const String& = "") {} // expected-note {{passing argument to parameter here}}
void test() {
takeString();
#if __cplusplus <= 199711L
// expected-note@-2 {{implicit copy assignment operator}}
#else
- // expected-error@-4 {{object of type 'ProtectedCheck::Z' cannot be assigned because its copy assignment operator is implicitly deleted}}
+ // expected-error@-4 {{object of type 'Z' cannot be assigned because its copy assignment operator is implicitly deleted}}
#endif
}
struct X1 : public virtual X0 { };
- struct X2 : X0, X1 { }; // expected-warning{{direct base 'MultiplePaths::X0' is inaccessible due to ambiguity:\n struct MultiplePaths::X2 -> struct MultiplePaths::X0\n struct MultiplePaths::X2 -> struct MultiplePaths::X1 -> struct MultiplePaths::X0}}
+ struct X2 : X0, X1 { }; // expected-warning{{direct base 'X0' is inaccessible due to ambiguity:\n struct MultiplePaths::X2 -> X0\n struct MultiplePaths::X2 -> X1 -> X0}}
void f(X2 x2) { x2 = x2; }
}
class B2 : public virtual A2 { };
class C2 : virtual public A2 { };
class D2 : public B2, public C2 { };
-class E2 : public D2, public C2, public virtual A2 { }; // expected-warning{{direct base 'C2' is inaccessible due to ambiguity:\n class E2 -> class D2 -> class C2\n class E2 -> class C2}}
-class F2 : public E2, public A2 { }; // expected-warning{{direct base 'A2' is inaccessible due to ambiguity:\n class F2 -> class E2 -> class D2 -> class B2 -> class A2\n class F2 -> class A2}}
+class E2 : public D2, public C2, public virtual A2 { }; // expected-warning{{direct base 'C2' is inaccessible due to ambiguity:\n class E2 -> D2 -> C2\n class E2 -> C2}}
+class F2 : public E2, public A2 { }; // expected-warning{{direct base 'A2' is inaccessible due to ambiguity:\n class F2 -> E2 -> D2 -> B2 -> A2\n class F2 -> A2}}
void g(E2* e2, F2* f2) {
Object2* o2;
void foo() {
B b;
b.~B();
- b.~A(); // expected-error{{destructor type 'PR7900::A' in object destruction expression does not match the type 'PR7900::B' of the object being destroyed}}
- (&b)->~A(); // expected-error{{destructor type 'PR7900::A' in object destruction expression does not match the type 'PR7900::B' of the object being destroyed}}
+ b.~A(); // expected-error{{destructor type 'PR7900::A' in object destruction expression does not match the type 'B' of the object being destroyed}}
+ (&b)->~A(); // expected-error{{destructor type 'PR7900::A' in object destruction expression does not match the type 'B' of the object being destroyed}}
}
}
//(void)dynamic_cast<A&>(*((D*)0));
// Ambiguous
- (void)dynamic_cast<A*>((F*)0); // expected-error {{ambiguous conversion from derived class 'F' to base class 'A':\n struct F -> struct B -> struct A\n struct F -> struct E -> struct A}}
- (void)dynamic_cast<A&>(*((F*)0)); // expected-error {{ambiguous conversion from derived class 'F' to base class 'A':\n struct F -> struct B -> struct A\n struct F -> struct E -> struct A}}
+ (void)dynamic_cast<A*>((F*)0); // expected-error {{ambiguous conversion from derived class 'F' to base class 'A':\n struct F -> B -> A\n struct F -> E -> A}}
+ (void)dynamic_cast<A&>(*((F*)0)); // expected-error {{ambiguous conversion from derived class 'F' to base class 'A':\n struct F -> B -> A\n struct F -> E -> A}}
}
void poly()
void test_X_elab(NS::X x) {
struct S4 *s4 = 0; // expected-note{{'S4' is not defined, but forward declared here; conversion would be valid if it was derived from 'NS::S4'}}
- x.test_elab2(s4); // expected-error{{cannot initialize a parameter of type 'NS::S4 *' with an lvalue of type 'struct S4 *'}}
+ x.test_elab2(s4); // expected-error{{cannot initialize a parameter of type 'S4 *' (aka 'NS::S4 *') with an lvalue of type 'struct S4 *'}}
}
namespace NS {
enum class X : unsigned { value };
void f(X x) {
- x % X::value; // expected-error{{invalid operands to binary expression ('rdar9366066::X' and 'rdar9366066::X')}}
- x % 8; // expected-error{{invalid operands to binary expression ('rdar9366066::X' and 'int')}}
+ x % X::value; // expected-error{{invalid operands to binary expression ('X' and 'rdar9366066::X')}}
+ x % 8; // expected-error{{invalid operands to binary expression ('X' and 'int')}}
}
}
namespace PR16900 {
enum class A;
- A f(A a) { return -a; } // expected-error {{invalid argument type 'PR16900::A' to unary expression}}
+ A f(A a) { return -a; } // expected-error {{invalid argument type 'A' to unary expression}}
}
namespace PR18551 {
typedef E E2;
E2 f1() { return E::a; }
- bool f() { return !f1(); } // expected-error {{invalid argument type 'test11::E2' (aka 'test11::E') to unary expression}}
+ bool f() { return !f1(); } // expected-error {{invalid argument type 'E2' (aka 'test11::E') to unary expression}}
}
namespace PR35586 {
enum E { e0 };
void f() {
E e;
- e = 1; // expected-error{{assigning to 'PR7051::E' from incompatible type 'int'}}
- e |= 1; // expected-error{{assigning to 'PR7051::E' from incompatible type 'int'}}
+ e = 1; // expected-error{{assigning to 'E' from incompatible type 'int'}}
+ e |= 1; // expected-error{{assigning to 'E' from incompatible type 'int'}}
}
}
void f1() {
try {
- } catch (B &b) { // expected-note {{for type 'HandlerInversion::B &'}}
- } catch (D &d) { // expected-warning {{exception of type 'HandlerInversion::D &' will be caught by earlier handler}}
+ } catch (B &b) { // expected-note {{for type 'B &'}}
+ } catch (D &d) { // expected-warning {{exception of type 'D &' will be caught by earlier handler}}
}
}
void f2() {
try {
- } catch (B *b) { // expected-note {{for type 'HandlerInversion::B *'}}
- } catch (D *d) { // expected-warning {{exception of type 'HandlerInversion::D *' will be caught by earlier handler}}
+ } catch (B *b) { // expected-note {{for type 'B *'}}
+ } catch (D *d) { // expected-warning {{exception of type 'D *' will be caught by earlier handler}}
}
}
void f6() {
try {
- } catch (B &b) { // expected-note {{for type 'HandlerInversion::B &'}}
- } catch (D2 &d) { // expected-warning {{exception of type 'HandlerInversion::D2 &' will be caught by earlier handler}}
+ } catch (B &b) { // expected-note {{for type 'B &'}}
+ } catch (D2 &d) { // expected-warning {{exception of type 'D2 &' will be caught by earlier handler}}
}
}
void f8() {
try {
- } catch (const B &b) { // expected-note {{for type 'const HandlerInversion::B &'}}
- } catch (D2 &d) { // expected-warning {{exception of type 'HandlerInversion::D2 &' will be caught by earlier handler}}
+ } catch (const B &b) { // expected-note {{for type 'const B &'}}
+ } catch (D2 &d) { // expected-warning {{exception of type 'D2 &' will be caught by earlier handler}}
}
try {
- } catch (B &b) { // expected-note {{for type 'HandlerInversion::B &'}}
- } catch (const D2 &d) { // expected-warning {{exception of type 'const HandlerInversion::D2 &' will be caught by earlier handler}}
+ } catch (B &b) { // expected-note {{for type 'B &'}}
+ } catch (const D2 &d) { // expected-warning {{exception of type 'const D2 &' will be caught by earlier handler}}
}
try {
- } catch (B b) { // expected-note {{for type 'HandlerInversion::B'}}
- } catch (D &d) { // expected-warning {{exception of type 'HandlerInversion::D &' will be caught by earlier handler}}
+ } catch (B b) { // expected-note {{for type 'B'}}
+ } catch (D &d) { // expected-warning {{exception of type 'D &' will be caught by earlier handler}}
}
}
}
void foo(vector arr[]) { // expected-note {{declared here}}
// Don't suggest to dereference arr.
for (auto i : arr) { }
- // expected-error@-1 {{cannot build range expression with array function parameter 'arr' since parameter with array type 'test6::vector[]' is treated as pointer type 'test6::vector *'}}
+ // expected-error@-1 {{cannot build range expression with array function parameter 'arr' since parameter with array type 'vector[]' is treated as pointer type 'vector *'}}
}
}
// For now this tests that a second 'extern "C"' is not necessary to trigger
// the warning.
struct A;
- extern "C" A f(void); // expected-warning {{'f' has C-linkage specified, but returns incomplete type 'test2::A' which could be incompatible with C}}
+ extern "C" A f(void); // expected-warning {{'f' has C-linkage specified, but returns incomplete type 'A' which could be incompatible with C}}
struct A {
A(const A&);
};
#pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
A xyzzy();
#pragma clang diagnostic pop
-A bbb(); // expected-warning {{'bbb' has C-linkage specified, but returns user-defined type 'rdar13364028::A' which is incompatible with C}}
-A ccc() { // expected-warning {{'ccc' has C-linkage specified, but returns user-defined type 'rdar13364028::A' which is incompatible with C}}
+A bbb(); // expected-warning {{'bbb' has C-linkage specified, but returns user-defined type 'A' which is incompatible with C}}
+A ccc() { // expected-warning {{'ccc' has C-linkage specified, but returns user-defined type 'A' which is incompatible with C}}
return A();
};
}
typedef D &Dr;
(void)Dr(*((A*)0)); // expected-error {{cannot cast 'A' to 'Dr' (aka 'D &') via virtual base 'B'}}
typedef H *Hp;
- (void)Hp((A*)0); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n struct A -> struct B -> struct G1 -> struct H\n struct A -> struct B -> struct G2 -> struct H}}
+ (void)Hp((A*)0); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n A -> B -> G1 -> struct H\n A -> B -> G2 -> struct H}}
typedef H &Hr;
- (void)Hr(*((A*)0)); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n struct A -> struct B -> struct G1 -> struct H\n struct A -> struct B -> struct G2 -> struct H}}
+ (void)Hr(*((A*)0)); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n A -> B -> G1 -> struct H\n A -> B -> G2 -> struct H}}
// TODO: Test DR427. This requires user-defined conversions, though.
}
using value_type = T;
using reference = value_type&;
reference get();
- const reference get() const; // qual-warning{{'const' qualifier on reference type 'container::reference' (aka 'T &') has no effect}}
+ const reference get() const; // qual-warning{{'const' qualifier on reference type 'reference' (aka 'T &') has no effect}}
};
template <typename EltTy0, unsigned R0, unsigned C0, typename EltTy1, unsigned R1, unsigned C1, typename EltTy2, unsigned R2, unsigned C2>
typename MyMatrix<EltTy2, R2, C2>::matrix_t add(MyMatrix<EltTy0, R0, C0> &A, MyMatrix<EltTy1, R1, C1> &B) {
char *v1 = A.value + B.value;
- // expected-error@-1 {{cannot initialize a variable of type 'char *' with an rvalue of type 'MyMatrix<unsigned int, 2, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))')}}
- // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'MyMatrix<float, 2, 2>::matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))'))}}
- // expected-error@-3 {{invalid operands to binary expression ('MyMatrix<unsigned int, 2, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))'))}}
+ // expected-error@-1 {{cannot initialize a variable of type 'char *' with an rvalue of type 'matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))')}}
+ // expected-error@-2 {{invalid operands to binary expression ('matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))'))}}
+ // expected-error@-3 {{invalid operands to binary expression ('matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))'))}}
return A.value + B.value;
- // expected-error@-1 {{invalid operands to binary expression ('MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'MyMatrix<float, 2, 2>::matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))'))}}
- // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<unsigned int, 2, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))'))}}
+ // expected-error@-1 {{invalid operands to binary expression ('matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))'))}}
+ // expected-error@-2 {{invalid operands to binary expression ('matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))'))}}
}
void test_add_template(unsigned *Ptr1, float *Ptr2) {
template <typename EltTy0, unsigned R0, unsigned C0, typename EltTy1, unsigned R1, unsigned C1, typename EltTy2, unsigned R2, unsigned C2>
typename MyMatrix<EltTy2, R2, C2>::matrix_t subtract(MyMatrix<EltTy0, R0, C0> &A, MyMatrix<EltTy1, R1, C1> &B) {
char *v1 = A.value - B.value;
- // expected-error@-1 {{cannot initialize a variable of type 'char *' with an rvalue of type 'MyMatrix<unsigned int, 2, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))')}}
- // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'MyMatrix<float, 2, 2>::matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))')}}
- // expected-error@-3 {{invalid operands to binary expression ('MyMatrix<unsigned int, 2, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))')}}
+ // expected-error@-1 {{cannot initialize a variable of type 'char *' with an rvalue of type 'matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))')}}
+ // expected-error@-2 {{invalid operands to binary expression ('matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))')}}
+ // expected-error@-3 {{invalid operands to binary expression ('matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))')}}
return A.value - B.value;
- // expected-error@-1 {{invalid operands to binary expression ('MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'MyMatrix<float, 2, 2>::matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))')}}
- // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<unsigned int, 2, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))')}}
+ // expected-error@-1 {{invalid operands to binary expression ('matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))')}}
+ // expected-error@-2 {{invalid operands to binary expression ('matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))')}}
}
void test_subtract_template(unsigned *Ptr1, float *Ptr2) {
typename MyMatrix<EltTy2, R2, C2>::matrix_t multiply(MyMatrix<EltTy0, R0, C0> &A, MyMatrix<EltTy1, R1, C1> &B) {
char *v1 = A.value * B.value;
// expected-error@-1 {{cannot initialize a variable of type 'char *' with an rvalue of type 'unsigned int __attribute__((matrix_type(2, 2)))'}}
- // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<unsigned int, 3, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 2)))') and 'MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))'))}}
- // expected-error@-3 {{invalid operands to binary expression ('MyMatrix<float, 2, 2>::matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))') and 'MyMatrix<unsigned int, 2, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))'))}}
+ // expected-error@-2 {{invalid operands to binary expression ('matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 2)))') and 'matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))'))}}
+ // expected-error@-3 {{invalid operands to binary expression ('matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))') and 'matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))'))}}
MyMatrix<int, 5, 6> m;
B.value = m.value * A.value;
- // expected-error@-1 {{invalid operands to binary expression ('MyMatrix<int, 5, 6>::matrix_t' (aka 'int __attribute__((matrix_type(5, 6)))') and 'MyMatrix<unsigned int, 2, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))'))}}
- // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<int, 5, 6>::matrix_t' (aka 'int __attribute__((matrix_type(5, 6)))') and 'MyMatrix<unsigned int, 3, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 2)))'))}}
- // expected-error@-3 {{invalid operands to binary expression ('MyMatrix<int, 5, 6>::matrix_t' (aka 'int __attribute__((matrix_type(5, 6)))') and 'MyMatrix<float, 2, 2>::matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))'))}}
+ // expected-error@-1 {{invalid operands to binary expression ('matrix_t' (aka 'int __attribute__((matrix_type(5, 6)))') and 'matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))'))}}
+ // expected-error@-2 {{invalid operands to binary expression ('matrix_t' (aka 'int __attribute__((matrix_type(5, 6)))') and 'matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 2)))'))}}
+ // expected-error@-3 {{invalid operands to binary expression ('matrix_t' (aka 'int __attribute__((matrix_type(5, 6)))') and 'matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))'))}}
return A.value * B.value;
- // expected-error@-1 {{invalid operands to binary expression ('MyMatrix<unsigned int, 3, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 2)))') and 'MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))'))}}
- // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<float, 2, 2>::matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))') and 'MyMatrix<unsigned int, 2, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))'))}}
+ // expected-error@-1 {{invalid operands to binary expression ('matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 2)))') and 'matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))'))}}
+ // expected-error@-2 {{invalid operands to binary expression ('matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))') and 'matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))'))}}
}
void test_multiply_template(unsigned *Ptr1, float *Ptr2) {
Mat4.value = Mat4.value * Mat1;
// expected-error@-1 {{no viable conversion from 'MyMatrix<unsigned int, 2, 2>' to 'unsigned int'}}
- // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<unsigned int, 3, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 2)))') and 'MyMatrix<unsigned int, 2, 2>')}}
+ // expected-error@-2 {{invalid operands to binary expression ('matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 2)))') and 'MyMatrix<unsigned int, 2, 2>')}}
}
struct UserT {};
void test_DoubleWrapper(MyMatrix<double, 10, 9> &m, StructWithC &c) {
m.value = m.value + c;
// expected-error@-1 {{no viable conversion from 'StructWithC' to 'double'}}
- // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<double, 10, 9>::matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))') and 'StructWithC')}}
+ // expected-error@-2 {{invalid operands to binary expression ('matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))') and 'StructWithC')}}
m.value = c + m.value;
// expected-error@-1 {{no viable conversion from 'StructWithC' to 'double'}}
- // expected-error@-2 {{invalid operands to binary expression ('StructWithC' and 'MyMatrix<double, 10, 9>::matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))'))}}
+ // expected-error@-2 {{invalid operands to binary expression ('StructWithC' and 'matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))'))}}
m.value = m.value - c;
// expected-error@-1 {{no viable conversion from 'StructWithC' to 'double'}}
- // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<double, 10, 9>::matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))') and 'StructWithC')}}
+ // expected-error@-2 {{invalid operands to binary expression ('matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))') and 'StructWithC')}}
m.value = c - m.value;
// expected-error@-1 {{no viable conversion from 'StructWithC' to 'double'}}
- // expected-error@-2 {{invalid operands to binary expression ('StructWithC' and 'MyMatrix<double, 10, 9>::matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))'))}}
+ // expected-error@-2 {{invalid operands to binary expression ('StructWithC' and 'matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))'))}}
}
sx5x10_t get_matrix();
}
void test1(A *x) {
- x.A::foo<int>(); // expected-error {{'test5::A *' is a pointer}}
+ x.A::foo<int>(); // expected-error {{'A *' is a pointer}}
}
void test2(A &x) {
- x->A::foo<int>(); // expected-error {{'test5::A' is not a pointer; did you mean to use '.'?}}
+ x->A::foo<int>(); // expected-error {{'A' is not a pointer; did you mean to use '.'?}}
}
}
template<typename T> struct Z { int n; };
void f(Y *y) {
- y->N::X1<int>; // expected-error{{'rdar8231724::N::X1' is not a member of class 'rdar8231724::Y'}}
- y->Z<int>::n; // expected-error{{'rdar8231724::Z<int>::n' is not a member of class 'rdar8231724::Y'}}
- y->template Z<int>::n; // expected-error{{'rdar8231724::Z<int>::n' is not a member of class 'rdar8231724::Y'}}
+ y->N::X1<int>; // expected-error{{'rdar8231724::N::X1' is not a member of class 'Y'}}
+ y->Z<int>::n; // expected-error{{'rdar8231724::Z<int>::n' is not a member of class 'Y'}}
+ y->template Z<int>::n; // expected-error{{'rdar8231724::Z<int>::n' is not a member of class 'Y'}}
#if __cplusplus <= 199711L // C++03 or earlier modes
// expected-warning@-2{{'template' keyword outside of a template}}
#endif
int f() {
Cl0 c;
- return c->a; // expected-error {{member reference type 'PR15045::Cl0' is not a pointer; did you mean to use '.'?}}
+ return c->a; // expected-error {{member reference type 'Cl0' is not a pointer; did you mean to use '.'?}}
}
struct bar {
};
template <class T> void call_func(T t) {
- t->func(); // expected-error-re 2 {{member reference type 'PR15045::bar' is not a pointer{{$}}}} \
+ t->func(); // expected-error-re 2 {{member reference type '{{(PR15045::)?}}bar' is not a pointer{{$}}}} \
// expected-note {{did you mean to use '.' instead?}}
}
foo f;
// Show that recovery has happened by also triggering typo correction
- e->Func(); // expected-error {{member reference type 'PR15045::bar' is not a pointer; did you mean to use '.'?}} \
+ e->Func(); // expected-error {{member reference type 'bar' is not a pointer; did you mean to use '.'?}} \
// expected-error {{no member named 'Func' in 'PR15045::bar'; did you mean 'func'?}}
// Make sure a fixit isn't given in the case that the '->' isn't actually
// the problem (the problem is with the return value of an operator->).
- f->func(); // expected-error-re {{member reference type 'PR15045::bar' is not a pointer{{$}}}}
+ f->func(); // expected-error-re {{member reference type 'bar' is not a pointer{{$}}}}
call_func(e); // expected-note {{in instantiation of function template specialization 'PR15045::call_func<PR15045::bar>' requested here}}
int f(S* s) {
T t;
return t.get_s // expected-error {{reference to non-static member function must be called; did you mean to call it with no arguments?}}
- .i; // expected-error {{member reference type 'pr16676::S *' is a pointer; did you mean to use '->'}}
+ .i; // expected-error {{member reference type 'S *' is a pointer; did you mean to use '->'}}
}
}
struct thing {};
struct another {
another() : r(thing()) {} // expected-error {{binds to a temporary object}}
- // expected-error@-1 {{temporary of type 'PR14838::function' has private destructor}}
+ // expected-error@-1 {{temporary of type 'function' has private destructor}}
const function &r; // expected-note {{reference member declared here}}
} af;
}
double y;
};
struct Sprite {
- Point location = Point(0,0); // expected-error {{no matching constructor for initialization of 'rdar14084171::Point'}}
+ Point location = Point(0,0); // expected-error {{no matching constructor for initialization of 'Point'}}
};
void f(Sprite& x) { x = x; } // expected-warning {{explicitly assigning value of variable}}
}
template<typename F> auto x(F f) -> decltype(f(make()));
#ifndef MS_COMPAT
-// expected-error@-2{{calling 'make' with incomplete return type 'PR13433::S'}}
+// expected-error@-2{{calling 'make' with incomplete return type 'S'}}
// expected-note@-5{{'make' declared here}}
// expected-note@-7{{forward declaration of 'PR13433::S'}}
#endif
int a;
};
-struct B : public A { // expected-note {{destructor of 'B' is implicitly deleted because base class 'Test2::A' has an inaccessible destructor}}
+struct B : public A { // expected-note {{destructor of 'B' is implicitly deleted because base class 'A' has an inaccessible destructor}}
int b;
};
struct ValueBoth : ValueInt, ValueEnum { };
struct IndirectValueInt : ValueInt { };
-struct TwoValueInts : ValueInt, IndirectValueInt { }; // expected-warning{{direct base 'ValueInt' is inaccessible due to ambiguity:\n struct TwoValueInts -> struct ValueInt\n struct TwoValueInts -> struct IndirectValueInt -> struct ValueInt}}
+struct TwoValueInts : ValueInt, IndirectValueInt { }; // expected-warning{{direct base 'ValueInt' is inaccessible due to ambiguity:\n struct TwoValueInts -> ValueInt\n struct TwoValueInts -> IndirectValueInt -> ValueInt}}
void test() {
#endif
struct B { B(); A a; };
#if __cplusplus <= 199711L
- // expected-error@-2 {{field of type 'ArrayNewNeedsDtor::A' has private destructor}}
+ // expected-error@-2 {{field of type 'A' has private destructor}}
#else
// expected-note@-4 {{destructor of 'B' is implicitly deleted because field 'a' has an inaccessible destructor}}
#endif
class C1 {};
struct S2 {
- void func(S1*); // expected-note {{type of 1st parameter of member declaration does not match definition ('N2::S1 *' vs 'N2::N1::S1 *')}}
- void func(C1&, unsigned, const S1*); // expected-note {{type of 3rd parameter of member declaration does not match definition ('const N2::S1 *' vs 'const N2::N1::S1 *')}}
- void func(const S1*, unsigned); //expected-note {{type of 1st parameter of member declaration does not match definition ('const N2::S1 *' vs 'N2::N1::S1')}}
+ void func(S1*); // expected-note {{type of 1st parameter of member declaration does not match definition ('S1 *' (aka 'N2::S1 *') vs 'S1 *' (aka 'N2::N1::S1 *'))}}
+ void func(C1&, unsigned, const S1*); // expected-note {{type of 3rd parameter of member declaration does not match definition ('const S1 *' (aka 'const N2::S1 *') vs 'const S1 *' (aka 'const N2::N1::S1 *'))}}
+ void func(const S1*, unsigned); //expected-note {{type of 1st parameter of member declaration does not match definition ('const S1 *' vs 'S1')}}
void func(unsigned, const S1*); // expected-note {{type of 1st parameter of member declaration does not match definition ('unsigned int' vs 'unsigned int *')}}
};
// RUN: %clang_cc1 -fsyntax-only -verify %s
namespace test0 {
- struct A { // expected-note {{candidate function (the implicit copy assignment operator) not viable: 'this' argument has type 'const test0::A', but method is not marked const}}
+ struct A { // expected-note {{candidate function (the implicit copy assignment operator) not viable: 'this' argument has type 'const A', but method is not marked const}}
#if __cplusplus >= 201103L
- // expected-note@-2 {{candidate function (the implicit move assignment operator) not viable: 'this' argument has type 'const test0::A', but method is not marked const}}
+ // expected-note@-2 {{candidate function (the implicit move assignment operator) not viable: 'this' argument has type 'const A', but method is not marked const}}
#endif
- A &operator=(void*); // expected-note {{candidate function not viable: 'this' argument has type 'const test0::A', but method is not marked const}}
+ A &operator=(void*); // expected-note {{candidate function not viable: 'this' argument has type 'const A', but method is not marked const}}
};
void test(const A &a) {
completeFunction(*P); // expected-error {{no matching function for call to 'completeFunction'}}
}
- void incompletePointerFunction(Incomplete *); // expected-note {{candidate function not viable: cannot convert argument of incomplete type 'IncompleteConversion::Incomplete' to 'IncompleteConversion::Incomplete *' for 1st argument; take the address of the argument with &}}
- void incompleteReferenceFunction(Incomplete &); // expected-note {{candidate function not viable: cannot convert argument of incomplete type 'IncompleteConversion::Incomplete *' to 'IncompleteConversion::Incomplete &' for 1st argument; dereference the argument with *}}
+ void incompletePointerFunction(Incomplete *); // expected-note {{candidate function not viable: cannot convert argument of incomplete type 'Incomplete' to 'Incomplete *' for 1st argument; take the address of the argument with &}}
+ void incompleteReferenceFunction(Incomplete &); // expected-note {{candidate function not viable: cannot convert argument of incomplete type 'Incomplete *' to 'Incomplete &' for 1st argument; dereference the argument with *}}
void testPointerReferenceConversion(Incomplete &reference, Incomplete *pointer) {
incompletePointerFunction(reference); // expected-error {{no matching function for call to 'incompletePointerFunction'}}
};
void f() {
- S()(0); // expected-error{{conversion from 'int' to 'PR6078::A' is ambiguous}}
+ S()(0); // expected-error{{conversion from 'int' to 'A' is ambiguous}}
}
}
void foo(int n, const char *s, int t, ...); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}
void foo(int n, const char *s, int t, int u = 0); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}
- void bar(double d); //expected-note {{candidate function not viable: 'this' argument has type 'const test1::A', but method is not marked const}}
- void bar(int i); //expected-note {{candidate function not viable: 'this' argument has type 'const test1::A', but method is not marked const}}
+ void bar(double d); //expected-note {{candidate function not viable: 'this' argument has type 'const A', but method is not marked const}}
+ void bar(int i); //expected-note {{candidate function not viable: 'this' argument has type 'const A', but method is not marked const}}
- void baz(A &d); // expected-note {{candidate function not viable: 1st argument ('const test1::A') would lose const qualifier}}
- void baz(int i); // expected-note {{candidate function not viable: no known conversion from 'const test1::A' to 'int' for 1st argument}}
+ void baz(A &d); // expected-note {{candidate function not viable: 1st argument ('const A') would lose const qualifier}}
+ void baz(int i); // expected-note {{candidate function not viable: no known conversion from 'const A' to 'int' for 1st argument}}
void ref() &&; // expected-note {{expects an rvalue for object argument}} expected-note {{requires 0 arguments, but 1 was provided}}
void ref(int) &; // expected-note {{expects an lvalue for object argument}} expected-note {{requires 1 argument, but 0 were provided}}
namespace b7398190 {
struct S {
- int f(); // expected-note {{'this' argument has type 'const b7398190::S', but method is not marked const}}
+ int f(); // expected-note {{'this' argument has type 'const S', but method is not marked const}}
void f(int); // expected-note {{requires 1 argument, but 0 were provided}}
};
const S *p;
namespace rdar9222009 {
class StringRef {
inline bool operator==(StringRef LHS, StringRef RHS) { // expected-error{{overloaded 'operator==' must be a binary operator (has 3 parameters)}}
- return !(LHS == RHS); // expected-error{{invalid operands to binary expression ('rdar9222009::StringRef' and 'rdar9222009::StringRef')}}
+ return !(LHS == RHS); // expected-error{{invalid operands to binary expression ('StringRef' and 'StringRef')}}
}
};
void h() {
D d;
d++; // ok
- ++d; // expected-error{{cannot increment value of type 'PR14995::D'}}
+ ++d; // expected-error{{cannot increment value of type 'D'}}
}
template<typename...T> struct E {
void test() {
Derived d;
- static_cast<Base *>(&d).~Base(); // expected-error {{member reference type 'dotPointerAccess::Base *' is a pointer; did you mean to use '->'}}
- d->~Derived(); // expected-error {{member reference type 'dotPointerAccess::Derived' is not a pointer; did you mean to use '.'}}
+ static_cast<Base *>(&d).~Base(); // expected-error {{member reference type 'Base *' is a pointer; did you mean to use '->'}}
+ d->~Derived(); // expected-error {{member reference type 'Derived' is not a pointer; did you mean to use '.'}}
}
typedef Derived *Foo;
void test2(Foo d) {
d.~Foo(); // This is ok
- d.~Derived(); // expected-error {{member reference type 'dotPointerAccess::Foo' (aka 'dotPointerAccess::Derived *') is a pointer; did you mean to use '->'}}
+ d.~Derived(); // expected-error {{member reference type 'Foo' (aka 'dotPointerAccess::Derived *') is a pointer; did you mean to use '->'}}
}
}
namespace test8 {
typedef int arr[];
int v = arr(); // expected-error {{array types cannot be value-initialized}} \
- expected-error {{cannot initialize a variable of type 'int' with an rvalue of type 'test8::arr'}}
+ expected-error {{cannot initialize a variable of type 'int' with an rvalue of type 'arr'}}
}
namespace test9 {
namespace test13 {
enum Circular { // expected-note {{not complete until the closing '}'}}
- Circular_A = Circular(1), // expected-error {{'test13::Circular' is an incomplete type}}
+ Circular_A = Circular(1), // expected-error {{'Circular' is an incomplete type}}
};
// Enumerators can be evaluated (they evaluate as zero, but we don't care).
static_assert(Circular_A == 0 && Circular_A != 0, ""); // expected-error {{static assertion failed}}
int& okay; // expected-note{{reference member 'okay' will never be initialized}}
};
-struct C : B, A { }; // expected-warning {{direct base 'A' is inaccessible due to ambiguity:\n struct C -> struct B -> struct A\nstruct C -> struct A}}
+struct C : B, A { }; // expected-warning {{direct base 'A' is inaccessible due to ambiguity:\n struct C -> B -> A\nstruct C -> A}}
void test7(C& c) {
A& a1 = c; // expected-error {{ambiguous conversion from derived class 'C' to base class 'A':}}
// This is invalid: we can't copy-initialize an 'A' temporary using an
// explicit constructor.
struct A { explicit A(int); };
- const A &a(0); // expected-error {{reference to type 'const ExplicitRefInit::A' could not bind to an rvalue of type 'int'}}
+ const A &a(0); // expected-error {{reference to type 'const A' could not bind to an rvalue of type 'int'}}
}
namespace RefCollapseTypePrinting {
(void)static_cast<B&>(*((const A*)0)); // expected-error {{static_cast from 'const A' to 'B &' casts away qualifiers}}
(void)static_cast<E*>((A*)0); // expected-error {{cannot cast private base class 'A' to 'E'}}
(void)static_cast<E&>(*((A*)0)); // expected-error {{cannot cast private base class 'A' to 'E'}}
- (void)static_cast<H*>((A*)0); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n struct A -> struct B -> struct G1 -> struct H\n struct A -> struct B -> struct G2 -> struct H}}
- (void)static_cast<H&>(*((A*)0)); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n struct A -> struct B -> struct G1 -> struct H\n struct A -> struct B -> struct G2 -> struct H}}
+ (void)static_cast<H*>((A*)0); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n A -> B -> G1 -> struct H\n struct A -> B -> G2 -> struct H}}
+ (void)static_cast<H&>(*((A*)0)); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n A -> B -> G1 -> struct H\n A -> B -> G2 -> struct H}}
(void)static_cast<E*>((B*)0); // expected-error {{static_cast from 'B *' to 'E *', which are not related by inheritance, is not allowed}}
(void)static_cast<E&>(*((B*)0)); // expected-error {{non-const lvalue reference to type 'E' cannot bind to a value of unrelated type 'B'}}
switch (d) {
case Defined::a:
break;
- case (Defined)2: // expected-warning {{case value not in enumerated type 'OpaqueEnumWarnings::Defined'}}
+ case (Defined)2: // expected-warning {{case value not in enumerated type 'Defined'}}
break;
}
}
struct S; //expected-note{{forward declaration of 'ErrorType::S'}}
struct T {
- S t; //expected-error{{field has incomplete type 'ErrorType::S'}}
+ S t; //expected-error{{field has incomplete type 'S'}}
};
bool b = __has_unique_object_representations(T);
};
#if __cplusplus <= 199711L // C++03 or earlier modes
// expected-warning@-2 {{C++98 requires an accessible copy constructor}}
#else
- // expected-warning@-4 {{copying parameter of type 'PR9323::(anonymous namespace)::Uncopyable' when binding a reference to a temporary would invoke an inaccessible constructor in C++98}}
+ // expected-warning@-4 {{copying parameter of type 'Uncopyable' when binding a reference to a temporary would invoke an inaccessible constructor in C++98}}
#endif
};
}
// expected-error@-1 {{ISO C++ forbids forward references to 'enum'}}
// expected-error@-2 {{variable has incomplete type}}
__underlying_type(Invalid) dont_crash;
- // expected-error@-1 {{cannot determine underlying type of incomplete enumeration type 'PR19966::Invalid'}}
+ // expected-error@-1 {{cannot determine underlying type of incomplete enumeration type 'Invalid'}}
}
enum E { // expected-note {{forward declaration of 'E'}}
a = (__underlying_type(E)){}
- // expected-error@-1 {{cannot determine underlying type of incomplete enumeration type 'PR19966::E'}}
+ // expected-error@-1 {{cannot determine underlying type of incomplete enumeration type 'E'}}
// expected-error@-2 {{constant expression}}
};
}
E e;
c &Value; // expected-error{{cannot convert between scalar type 'PR45780::E' and vector type 'char16'}}
c == Value; // expected-error{{cannot convert between scalar type 'PR45780::E' and vector type 'char16'}}
- e | c; // expected-error{{cannot convert between scalar type 'PR45780::E' and vector type 'char16'}}
- e != c; // expected-error{{cannot convert between scalar type 'PR45780::E' and vector type 'char16'}}
+ e | c; // expected-error{{cannot convert between scalar type 'E' and vector type 'char16'}}
+ e != c; // expected-error{{cannot convert between scalar type 'E' and vector type 'char16'}}
}
} // namespace PR45780
};
class B : A {
- virtual b* f(); // expected-error{{return type of virtual function 'f' is not covariant with the return type of the function it overrides ('T2::b *' is not derived from 'T2::a *')}}
+ virtual b* f(); // expected-error{{return type of virtual function 'f' is not covariant with the return type of the function it overrides ('b *' is not derived from 'a *')}}
};
}
};
class B : A {
- virtual b* f(); // expected-error{{invalid covariant return for virtual function: 'T3::a' is a private base class of 'T3::b'}}
+ virtual b* f(); // expected-error{{invalid covariant return for virtual function: 'a' is a private base class of 'b'}}
};
}
struct a { };
struct a1 : a { };
-struct b : a, a1 { }; // expected-warning{{direct base 'T4::a' is inaccessible due to ambiguity:\n struct T4::b -> struct T4::a\n struct T4::b -> struct T4::a1 -> struct T4::a}}
+struct b : a, a1 { }; // expected-warning{{direct base 'a' is inaccessible due to ambiguity:\n struct T4::b -> a\n struct T4::b -> a1 -> a}}
class A {
virtual a* f(); // expected-note{{overridden virtual function is here}}
};
class B : A {
- virtual b* f(); // expected-error{{return type of virtual function 'f' is not covariant with the return type of the function it overrides (ambiguous conversion from derived class 'T4::b' to base class 'T4::a':\n\
- struct T4::b -> struct T4::a\n\
- struct T4::b -> struct T4::a1 -> struct T4::a)}}
+ virtual b* f(); // expected-error{{return type of virtual function 'f' is not covariant with the return type of the function it overrides (ambiguous conversion from derived class 'b' to base class 'a':\n\
+ struct T4::b -> a\n\
+ struct T4::b -> a1 -> a)}}
};
}
class B : A {
virtual a* const f();
- virtual a* g(); // expected-error{{return type of virtual function 'g' is not covariant with the return type of the function it overrides ('T5::a *' has different qualifiers than 'T5::a *const')}}
+ virtual a* g(); // expected-error{{return type of virtual function 'g' is not covariant with the return type of the function it overrides ('a *' has different qualifiers than 'a *const')}}
};
}
class B : A {
virtual a* f();
- virtual const a* g(); // expected-error{{return type of virtual function 'g' is not covariant with the return type of the function it overrides (class type 'const T6::a *' is more qualified than class type 'T6::a *'}}
+ virtual const a* g(); // expected-error{{return type of virtual function 'g' is not covariant with the return type of the function it overrides (class type 'const a *' is more qualified than class type 'a *'}}
};
}
};
class B : A {
- b* f(); // expected-error {{return type of virtual function 'f' is not covariant with the return type of the function it overrides ('T8::b' is incomplete)}}
+ b* f(); // expected-error {{return type of virtual function 'f' is not covariant with the return type of the function it overrides ('b' is incomplete)}}
};
}
};
template <int N, int M> struct X1 : X<N> {
virtual TD<M>* f1(); // expected-error{{return type of virtual function 'f1' is not covariant with the return type of the function it overrides ('TD<1> *'}}
- virtual D* f2(); // expected-error{{return type of virtual function 'f2' is not covariant with the return type of the function it overrides ('type_dependent_covariance::D *' is not derived from 'TB<1> *')}}
+ virtual D* f2(); // expected-error{{return type of virtual function 'f2' is not covariant with the return type of the function it overrides ('D *' is not derived from 'TB<1> *')}}
};
X1<0, 0> good;
};
struct D : C {
- virtual B&& f(); // expected-error {{virtual function 'f' has a different return type ('T11::B &&') than the function it overrides (which has return type 'T11::A &')}}
+ virtual B&& f(); // expected-error {{virtual function 'f' has a different return type ('B &&') than the function it overrides (which has return type 'A &')}}
};
};
};
struct D : C {
- virtual B& f(); // expected-error {{virtual function 'f' has a different return type ('T12::B &') than the function it overrides (which has return type 'T12::A &&')}}
+ virtual B& f(); // expected-error {{virtual function 'f' has a different return type ('B &') than the function it overrides (which has return type 'A &&')}}
};
};
namespace recursive_class {
struct S {
S v;
- // expected-error@-1{{field has incomplete type 'recursive_class::S'}}
+ // expected-error@-1{{field has incomplete type 'S'}}
// expected-note@-3{{definition of 'recursive_class::S' is not complete until the closing '}'}}
} a;
while (B1 == B2); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
while (name1::B2 == name2::B3); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
- while (z == name2::B2); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
+ while (z == name2::B2); // expected-warning {{comparison of different enumeration types ('Baz' and 'name2::Baz')}}
while (((((B1)))) == B2); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
while (name1::B2 == (name2::B3)); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
- while (z == ((((name2::B2))))); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
+ while (z == ((((name2::B2))))); // expected-warning {{comparison of different enumeration types ('Baz' and 'name2::Baz')}}
while ((((B1))) == (((B2)))); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
while ((name1::B2) == (((name2::B3)))); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
- while ((((z))) == (name2::B2)); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
+ while ((((z))) == (name2::B2)); // expected-warning {{comparison of different enumeration types ('Baz' and 'name2::Baz')}}
while (x == a); // expected-warning {{comparison of different enumeration types ('Foo' and 'name1::Foo')}}
while (x == b); // expected-warning {{comparison of different enumeration types ('Foo' and 'oneFoo' (aka 'name1::Foo'))}}
while (td == c); // expected-warning {{comparison of different enumeration types ('TD' and 'twoFoo' (aka 'name1::Foo'))}}
while (td == x); // expected-warning {{comparison of different enumeration types ('TD' and 'Foo')}}
while (td == y); // expected-warning {{comparison of different enumeration types ('TD' and 'Bar')}}
- while (td == z); // expected-warning {{comparison of different enumeration types ('TD' and 'name1::Baz')}}
+ while (td == z); // expected-warning {{comparison of different enumeration types ('TD' and 'Baz')}}
while (a == TD1); // expected-warning {{comparison of different enumeration types ('name1::Foo' and 'TD')}}
while (b == TD2); // expected-warning {{comparison of different enumeration types ('oneFoo' (aka 'name1::Foo') and 'TD')}}
while (c == TD1); // expected-warning {{comparison of different enumeration types ('twoFoo' (aka 'name1::Foo') and 'TD')}}
while (x == TD2); // expected-warning {{comparison of different enumeration types ('Foo' and 'TD')}}
while (y == TD1); // expected-warning {{comparison of different enumeration types ('Bar' and 'TD')}}
- while (z == TD2); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'TD')}}
+ while (z == TD2); // expected-warning {{comparison of different enumeration types ('Baz' and 'TD')}}
switch (a) {
case name1::F1: break;
void helper() {
Test t;
- new Test; // expected-warning {{type 'test1::Test' requires 256 bytes of alignment and the default allocator only guarantees}}
- new Test[10]; // expected-warning {{type 'test1::Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+ new Test; // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+ new Test[10]; // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
}
}
void helper() {
Test t;
- new Test; // expected-warning {{type 'test1::Test' requires 256 bytes of alignment and the default allocator only guarantees}}
- new Test[10]; // expected-warning {{type 'test1::Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+ new Test; // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+ new Test[10]; // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
}
}
void helper() {
Test t;
- new Test; // expected-warning {{type 'test2::Test' requires 256 bytes of alignment and the default allocator only guarantees}}
- new Test[10]; // expected-warning {{type 'test2::Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+ new Test; // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+ new Test[10]; // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
}
}
void helper() {
Test t;
new Test;
- new Test[10]; // expected-warning {{type 'test3::Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+ new Test[10]; // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
}
}
void helper() {
Test t;
- new Test; // expected-warning {{type 'test4::Test' requires 256 bytes of alignment and the default allocator only guarantees}}
+ new Test; // expected-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
new Test[10];
}
}
};
class DDVA : public virtual DA {
};
-class DMA : public virtual A, public virtual DA { //expected-warning{{direct base 'A' is inaccessible due to ambiguity:\n class DMA -> class A\n class DMA -> class DA -> class A}}
+class DMA : public virtual A, public virtual DA { //expected-warning{{direct base 'A' is inaccessible due to ambiguity:\n class DMA -> A\n class DMA -> DA -> A}}
};
class B;
namespace BaseMalformed {
struct A; // expected-note {{forward declaration of 'BaseMalformed::A'}}
struct B {
- A a; // expected-error {{field has incomplete type 'BaseMalformed::A'}}
+ A a; // expected-error {{field has incomplete type 'A'}}
};
struct C : public B {} c;
B *b = reinterpret_cast<B *>(&c);
struct A; // expected-note {{forward declaration of 'ChildMalformed::A'}}
struct B {};
struct C : public B {
- A a; // expected-error {{field has incomplete type 'ChildMalformed::A'}}
+ A a; // expected-error {{field has incomplete type 'A'}}
} c;
B *b = reinterpret_cast<B *>(&c);
} // end anonymous namespace
namespace BaseBaseMalformed {
struct A; // expected-note {{forward declaration of 'BaseBaseMalformed::A'}}
struct Y {};
- struct X { A a; }; // expected-error {{field has incomplete type 'BaseBaseMalformed::A'}}
+ struct X { A a; }; // expected-error {{field has incomplete type 'A'}}
struct B : Y, X {};
struct C : B {} c;
B *p = reinterpret_cast<B*>(&c);
// Virtual base class outside upcast base-chain is malformed.
namespace VBaseMalformed{
struct A; // expected-note {{forward declaration of 'VBaseMalformed::A'}}
- struct X { A a; }; // expected-error {{field has incomplete type 'VBaseMalformed::A'}}
+ struct X { A a; }; // expected-error {{field has incomplete type 'A'}}
struct B : public virtual X {};
struct C : B {} c;
B *p = reinterpret_cast<B*>(&c);
struct S3 { };
struct S4: virtual S3, S2 {
- S4() : S2(), // expected-warning {{base class 'T1::S2' will be initialized after base 'T1::S3'}}
+ S4() : S2(), // expected-warning {{base class 'S2' will be initialized after base 'S3'}}
S3() { };
};
}
int a GUARDED_BY(mu1_);
int b GUARDED_BY(mu2_);
int c GUARDED_BY(mu3_); // \
- // expected-warning {{'guarded_by' attribute requires arguments whose type is annotated with 'capability' attribute; type here is 'InheritanceTest::Derived3'}}
+ // expected-warning {{'guarded_by' attribute requires arguments whose type is annotated with 'capability' attribute; type here is 'Derived3'}}
void foo() EXCLUSIVE_LOCKS_REQUIRED(mu1_, mu2_) {
a = 0;
int gone_fishing() {
Fish F;
int Result = *F; // user-defined dereference operators work
- // expected-error@+1 {{member reference type 'Fish::Fins' is not a pointer}}
+ // expected-error@+1 {{member reference type 'Fins' is not a pointer}}
Result += F->Left;
return Result;
}
template<typename T>
struct make_weak_fail {
typedef T T_type;
- typedef __weak T_type type; // expected-error{{the type 'make_weak_fail<__weak id>::T_type' (aka '__weak id') is already explicitly ownership-qualified}} \
- // expected-error{{the type 'make_weak_fail<id>::T_type' (aka '__strong id') is already explicitly ownership-qualified}}
+ typedef __weak T_type type; // expected-error{{the type 'T_type' (aka '__weak id') is already explicitly ownership-qualified}} \
+ // expected-error{{the type 'T_type' (aka '__strong id') is already explicitly ownership-qualified}}
};
int check_make_weak_fail0[is_same<make_weak_fail<__weak id>::type, __weak id>::value? 1 : -1]; // expected-note{{in instantiation of template class 'make_weak_fail<__weak id>' requested here}}
B1 test_move() {
__block B0 b;
- return b; // expected-error {{no viable conversion from returned value of type 'MoveBlockVariable::B0' to function return type 'MoveBlockVariable::B1'}}
+ return b; // expected-error {{no viable conversion from returned value of type 'B0' to function return type 'B1'}}
}
}
// expected-error@+2 {{'A' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
// expected-error@+1 {{'field1' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
C.field1 = A;
- // expected-error@+2 {{expression requires 128 bit size 'Z::BIGTYPE' (aka '__float128') type support, but target 'spir64' does not support it}}
- // expected-error@+1 {{'bigfield' requires 128 bit size 'Z::BIGTYPE' (aka '__float128') type support, but target 'spir64' does not support it}}
+ // expected-error@+2 {{expression requires 128 bit size 'BIGTYPE' (aka '__float128') type support, but target 'spir64' does not support it}}
+ // expected-error@+1 {{'bigfield' requires 128 bit size 'BIGTYPE' (aka '__float128') type support, but target 'spir64' does not support it}}
C.bigfield += 1.0;
// expected-error@+1 {{'A' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
// expected-error@+2 {{'A' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
// expected-error@+1 {{'field1' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
C.field1 = A;
- // expected-error@+2 {{expression requires 128 bit size 'Z::BIGTYPE' (aka '__int128') type support, but target 'spir64' does not support it}}
- // expected-error@+1 {{'bigfield' requires 128 bit size 'Z::BIGTYPE' (aka '__int128') type support, but target 'spir64' does not support it}}
+ // expected-error@+2 {{expression requires 128 bit size 'BIGTYPE' (aka '__int128') type support, but target 'spir64' does not support it}}
+ // expected-error@+1 {{'bigfield' requires 128 bit size 'BIGTYPE' (aka '__int128') type support, but target 'spir64' does not support it}}
C.bigfield += 1.0;
// expected-error@+1 {{'A' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
};
};
template <typename T>
-struct T1 : public T0, public T { //expected-warning{{direct base 'T0' is inaccessible due to ambiguity:\n struct T1<struct A> -> struct T0\n struct T1<struct A> -> struct A -> struct T0}}
+struct T1 : public T0, public T { //expected-warning{{direct base 'T0' is inaccessible due to ambiguity:\n struct T1<struct A> -> T0\n struct T1<struct A> -> A -> T0}}
void f0() {
m0 = 0; // expected-error{{ambiguous conversion}}
}
using Z = const C<double>; // expected-note {{'Z' declared here}}
template<typename T> struct [[clang::preferred_name(C<int>)]] C; // expected-error {{argument 'C<int>' to 'preferred_name' attribute is not a typedef for a specialization of 'C'}}
template<typename T> struct [[clang::preferred_name(X), clang::preferred_name(Y)]] C;
- template<typename T> struct [[clang::preferred_name(const X)]] C; // expected-error {{argument 'const preferred_name::X'}}
- template<typename T> struct [[clang::preferred_name(Z)]] C; // expected-error {{argument 'preferred_name::Z' (aka 'const C<double>')}}
+ template<typename T> struct [[clang::preferred_name(const X)]] C; // expected-error {{argument 'const X'}}
+ template<typename T> struct [[clang::preferred_name(Z)]] C; // expected-error {{argument 'Z' (aka 'const C<double>')}}
template<typename T> struct C {};
// CHECK: ClassTemplateDecl {{.*}} <line:[[@LINE-10]]:{{.*}} C
// CHECK: ClassTemplateSpecializationDecl {{.*}} struct C definition
// CHECK: TemplateArgument type 'int'
// CHECK-NOT: PreferredNameAttr
- // CHECK: PreferredNameAttr {{.*}} preferred_name::X
+ // CHECK: PreferredNameAttr {{.*}} X
// CHECK-NOT: PreferredNameAttr
// CHECK: CXXRecordDecl
// CHECK: ClassTemplateSpecializationDecl {{.*}} struct C definition
// CHECK: TemplateArgument type 'float'
// CHECK-NOT: PreferredNameAttr
- // CHECK: PreferredNameAttr {{.*}} preferred_name::Y
+ // CHECK: PreferredNameAttr {{.*}} Y
// CHECK-NOT: PreferredNameAttr
// CHECK: CXXRecordDecl
// CHECK: ClassTemplateSpecializationDecl {{.*}} struct C definition
// CHECK: `-ParmVarDecl {{.*}} 'short (*)[4]'
// CHECK: FunctionProtoType {{.*}} 'auto (X<Ps...>, Ts (*)[Ns]...) -> A<T, Ts...>' dependent trailing_return
// CHECK: |-InjectedClassNameType {{.*}} 'A<T, Ts...>' dependent
-// CHECK: |-TemplateSpecializationType {{.*}} 'X<Ps...>' dependent X
-// CHECK: | `-TemplateArgument expr
-// CHECK: | `-PackExpansionExpr {{.*}} 'T *'
-// CHECK: | `-DeclRefExpr {{.*}} 'T *' NonTypeTemplateParm {{.*}} 'Ps' 'T *'
+// CHECK: |-ElaboratedType {{.*}} 'X<Ps...>' sugar dependent
+// CHECK: | `-TemplateSpecializationType {{.*}} 'X<Ps...>' dependent X
+// CHECK: | `-TemplateArgument expr
+// CHECK: | `-PackExpansionExpr {{.*}} 'T *'
+// CHECK: | `-DeclRefExpr {{.*}} 'T *' NonTypeTemplateParm {{.*}} 'Ps' 'T *'
// CHECK: `-PackExpansionType {{.*}} 'Ts (*)[Ns]...' dependent
// CHECK: `-PointerType {{.*}} 'Ts (*)[Ns]' dependent contains_unexpanded_pack
// CHECK: `-ParenType {{.*}} 'Ts[Ns]' sugar dependent contains_unexpanded_pack
// CHECK: |-InjectedClassNameType {{.*}} 'C<A>' dependent
// CHECK: |-TemplateTypeParmType {{.*}} 'A' dependent depth 0 index 0
// CHECK: | `-TemplateTypeParm {{.*}} 'A'
-// CHECK: |-TemplateSpecializationType {{.*}} 'Y<>' dependent Y
-// CHECK: | `-TemplateArgument template
+// CHECK: |-ElaboratedType {{.*}} 'Y<>' sugar dependent
+// CHECK: | `-TemplateSpecializationType {{.*}} 'Y<>' dependent Y
+// CHECK: | `-TemplateArgument template
// CHECK: `-TemplateTypeParmType {{.*}} 'type-parameter-0-2' dependent depth 0 index 2
template<typename ...T> struct D { // expected-note {{candidate}}
// CHECK: FunctionDecl {{.*}} used func 'void ()'\r
// CHECK-NEXT: TemplateArgument type 'int'\r
// CHECK: LambdaExpr {{.*}} '(lambda at\r
-// CHECK: ParmVarDecl {{.*}} used f 'foo' cinit\r
+// CHECK: ParmVarDecl {{.*}} used f 'foo':'foo' cinit\r
// CHECK-NEXT: DeclRefExpr {{.*}} 'foo' EnumConstant {{.*}} 'a' 'foo'\r
\r
namespace PR28795 {\r
// CHECK: ClassTemplateSpecializationDecl {{.*}} struct class2 definition\r
// CHECK: TemplateArgument type 'int'\r
// CHECK: LambdaExpr {{.*}} '(lambda at\r
-// CHECK: ParmVarDecl {{.*}} used f 'foo' cinit\r
+// CHECK: ParmVarDecl {{.*}} used f 'foo':'foo' cinit\r
// CHECK-NEXT: DeclRefExpr {{.*}} 'foo' EnumConstant {{.*}} 'a' 'foo'\r
\r
// Template struct case:\r
// CHECK-NEXT: FunctionDecl {{.*}} f1 'void ()'\r
// CHECK: FunctionDecl {{.*}} f1 'void ()'\r
// CHECK-NEXT: TemplateArgument type 'int'\r
-// CHECK: ParmVarDecl {{.*}} n 'foo' cinit\r
+// CHECK: ParmVarDecl {{.*}} n 'foo':'foo' cinit\r
// CHECK-NEXT: DeclRefExpr {{.*}} 'foo' EnumConstant {{.*}} 'a' 'foo'\r
\r
template<typename T>\r
namespace rdar12629723 {
template<class T>
struct X {
- struct C : public C { }; // expected-error{{circular inheritance between 'rdar12629723::X::C' and 'rdar12629723::X::C'}}
+ struct C : public C { }; // expected-error{{circular inheritance between 'C' and 'rdar12629723::X::C'}}
struct B;
- struct A : public B { // expected-note{{'rdar12629723::X::A' declared here}}
+ struct A : public B { // expected-note{{'A' declared here}}
virtual void foo() { }
};
};
template<class T>
- struct X<T>::B : public A { // expected-error{{circular inheritance between 'rdar12629723::X::A' and 'rdar12629723::X::B'}}
+ struct X<T>::B : public A { // expected-error{{circular inheritance between 'A' and 'rdar12629723::X::B'}}
virtual void foo() { }
};
}
namespace test1 {
template<typename T> struct A {
struct B { // expected-note {{not complete until the closing '}'}}
- B b; // expected-error {{has incomplete type 'test1::A<int>::B'}}
+ B b; // expected-error {{has incomplete type 'B'}}
};
B b; // expected-note {{in instantiation of}}
};
typedef int (A::*P);
template<typename T> struct S : T {
void f() {
- P(&T::X) // expected-error {{cannot cast from type 'int *' to member pointer type 'AddrOfMember::P'}}
+ P(&T::X) // expected-error {{cannot cast from type 'int *' to member pointer type 'P'}}
== &A::X;
}
};
void get(B **ptr) {
// It's okay if at some point we figure out how to diagnose this
// at instantiation time.
- *ptr = field; // expected-error {{incompatible pointer types assigning to 'test6::B *' from 'test6::A *'}}
+ *ptr = field; // expected-error {{incompatible pointer types assigning to 'B *' from 'A *'}}
}
};
}
};
template <typename T> struct C : T {
- int foo() { return b; } // expected-error {{no member named 'b' in 'PR16014::C<PR16014::A>'}} expected-warning {{lookup into dependent bases}}
- int *bar() { return &b; } // expected-error {{no member named 'b' in 'PR16014::C<PR16014::A>'}} expected-warning {{lookup into dependent bases}}
+ int foo() { return b; } // expected-error {{no member named 'b' in 'PR16014::C<A>'}} expected-warning {{lookup into dependent bases}}
+ int *bar() { return &b; } // expected-error {{no member named 'b' in 'PR16014::C<A>'}} expected-warning {{lookup into dependent bases}}
int baz() { return T::b; } // expected-error {{no member named 'b' in 'PR16014::A'}}
int T::*qux() { return &T::b; } // expected-error {{no member named 'b' in 'PR16014::A'}}
int T::*fuz() { return &U::a; } // expected-error {{use of undeclared identifier 'U'}} \
};
static_assert(C<A>); // expected-error {{static assertion failed}}
- // expected-note@-1 {{because 'PR52909b::A' does not satisfy 'C'}}
+ // expected-note@-1 {{because 'A' does not satisfy 'C'}}
} // namespace PR52909b
};
static_assert(C<S>); // expected-error {{static assertion failed}}
- // expected-note@-1 {{because 'PR53075::S' does not satisfy 'C'}}
+ // expected-note@-1 {{because 'S' does not satisfy 'C'}}
} // namespace PR53075
static_assert(C<Good>);
static_assert(!C<Bad>);
static_assert(C<Bad>); // cxx20-error {{static assertion failed}}
- // cxx20-note@-1 {{because 'DotFollowingFunctionName::Bad' does not satisfy 'C'}}
+ // cxx20-note@-1 {{because 'Bad' does not satisfy 'C'}}
#endif
} // namespace DotFollowingFunctionName
static_assert(C<Good>);
static_assert(!C<Bad>);
static_assert(C<Bad>); // cxx20-error {{static assertion failed}}
- // cxx20-note@-1 {{because 'DotFollowingPointer::Bad' (aka 'Holder<Incomplete> *') does not satisfy 'C'}}
+ // cxx20-note@-1 {{because 'Bad' (aka 'Holder<Incomplete> *') does not satisfy 'C'}}
#endif
} // namespace DotFollowingPointer
struct X { constexpr operator int() { return 0; } } x;
template<X &> struct C {};
- template<int N> int c(C<N>); // expected-error {{value of type 'int' is not implicitly convertible to 'DeduceDifferentType::X &'}}
+ template<int N> int c(C<N>); // expected-error {{value of type 'int' is not implicitly convertible to 'X &'}}
int c_imp = c(C<x>()); // expected-error {{no matching function}}
int c_exp = c<x>(C<x>()); // expected-error {{no matching function}}
static_assert(&id<A{1,2}> == &id<a>);
static_assert(&id<A{1,3}> != &id<a>);
- int k = id<1>; // expected-error {{no viable conversion from 'int' to 'ClassNTTP::A'}}
+ int k = id<1>; // expected-error {{no viable conversion from 'int' to 'A'}}
struct B {
constexpr B() {}
constexpr B(int) = delete; // expected-note {{here}}
};
template<B> struct Q {}; // expected-note {{passing argument to parameter here}}
- Q<1> q; // expected-error {{conversion function from 'int' to 'ClassNTTP::B' invokes a deleted function}}
+ Q<1> q; // expected-error {{conversion function from 'int' to 'B' invokes a deleted function}}
struct C {
constexpr C() {}
};
template <A> struct X {};
void f(X<1.0f>) {} // OK, user-defined conversion
- void f(X<2>) {} // expected-error {{conversion from 'int' to 'ConvertedConstant::A' is not allowed in a converted constant expression}}
+ void f(X<2>) {} // expected-error {{conversion from 'int' to 'A' is not allowed in a converted constant expression}}
}
namespace CopyCounting {
public:
class Inner : public A { };
#if __cplusplus <= 199711L
-// expected-error@-2{{base class 'PR7114::A' has private destructor}}
+// expected-error@-2{{base class 'A' has private destructor}}
#else
// expected-error@-4 2 {{deleted function '~Inner' cannot override a non-deleted function}}
-// expected-note@-5 2 {{destructor of 'Inner' is implicitly deleted because base class 'PR7114::A' has an inaccessible destructor}}
+// expected-note@-5 2 {{destructor of 'Inner' is implicitly deleted because base class 'A' has an inaccessible destructor}}
#ifdef MSABI
-// expected-note@-7 1 {{destructor of 'Inner' is implicitly deleted because base class 'PR7114::A' has an inaccessible destructor}}
+// expected-note@-7 1 {{destructor of 'Inner' is implicitly deleted because base class 'A' has an inaccessible destructor}}
#endif
#endif
struct X : A {
#if __cplusplus >= 201103L
// expected-error@-2 {{deleted function '~X' cannot override a non-deleted function}}
-// expected-note@-3 {{destructor of 'X<int>' is implicitly deleted because base class 'PR7114::A' has an inaccessible destructor}}
+// expected-note@-3 {{destructor of 'X<int>' is implicitly deleted because base class 'A' has an inaccessible destructor}}
#endif
void f() { }
};
"typedef dummy<int> declToImport;"
"template class dummy<int>;",
Lang_CXX03, "", Lang_CXX03, Verifier,
- typedefDecl(hasType(templateSpecializationType(
+ typedefDecl(hasType(elaboratedType(namesType(templateSpecializationType(
hasDeclaration(classTemplateSpecializationDecl(hasSpecializedTemplate(
- classTemplateDecl(hasTemplateDecl(cxxRecordDecl(hasMethod(allOf(
- hasName("f"),
- hasBody(compoundStmt(has(declStmt(hasSingleDecl(
- varDecl(hasInitializer(parenListExpr(has(unaryOperator(
- hasOperatorName("*"),
- hasUnaryOperand(cxxThisExpr())))))))))))))))))))))));
+ classTemplateDecl(hasTemplateDecl(cxxRecordDecl(hasMethod(
+ allOf(hasName("f"),
+ hasBody(compoundStmt(has(declStmt(hasSingleDecl(varDecl(
+ hasInitializer(parenListExpr(has(unaryOperator(
+ hasOperatorName("*"),
+ hasUnaryOperand(
+ cxxThisExpr())))))))))))))))))))))))));
}
TEST_P(ImportExpr, ImportSwitch) {
TEST_P(ImportExpr, ImportInitListExpr) {
MatchVerifier<Decl> Verifier;
- testImport(
- "void declToImport() {"
- " struct point { double x; double y; };"
- " point ptarray[10] = { [2].y = 1.0, [2].x = 2.0,"
- " [0].x = 1.0 }; }",
- Lang_CXX03, "", Lang_CXX03, Verifier,
- functionDecl(hasDescendant(initListExpr(
- has(cxxConstructExpr(requiresZeroInitialization())),
- has(initListExpr(
- hasType(asString("struct point")), has(floatLiteral(equals(1.0))),
- has(implicitValueInitExpr(hasType(asString("double")))))),
- has(initListExpr(hasType(asString("struct point")),
- has(floatLiteral(equals(2.0))),
- has(floatLiteral(equals(1.0)))))))));
+ testImport("void declToImport() {"
+ " struct point { double x; double y; };"
+ " point ptarray[10] = { [2].y = 1.0, [2].x = 2.0,"
+ " [0].x = 1.0 }; }",
+ Lang_CXX03, "", Lang_CXX03, Verifier,
+ functionDecl(hasDescendant(initListExpr(
+ has(cxxConstructExpr(requiresZeroInitialization())),
+ has(initListExpr(
+ hasType(asString("point")), has(floatLiteral(equals(1.0))),
+ has(implicitValueInitExpr(hasType(asString("double")))))),
+ has(initListExpr(hasType(asString("point")),
+ has(floatLiteral(equals(2.0))),
+ has(floatLiteral(equals(1.0)))))))));
}
const internal::VariadicDynCastAllOfMatcher<Expr, CXXDefaultInitExpr>
testImport("struct C {};"
"void declToImport() { using ::C; new C{}; }",
Lang_CXX11, "", Lang_CXX11, Verifier,
- functionDecl(hasDescendant(
- cxxNewExpr(hasType(pointerType(pointee(usingType())))))));
+ functionDecl(hasDescendant(cxxNewExpr(hasType(pointerType(
+ pointee(elaboratedType(namesType(usingType())))))))));
}
TEST_P(ImportDecl, ImportFunctionTemplateDecl) {
"class C { public: C(T); };"
"C declToImport(123);",
Lang_CXX17, "", Lang_CXX17, Verifier,
- varDecl(hasType(deducedTemplateSpecializationType())));
+ varDecl(hasType(elaboratedType(
+ namesType(deducedTemplateSpecializationType())))));
}
const internal::VariadicDynCastAllOfMatcher<Stmt, SizeOfPackExpr>
"void declToImport() {"
"using ns::S; X<S> xi; }",
Lang_CXX11, "", Lang_CXX11, Verifier,
- functionDecl(
- hasDescendant(varDecl(hasTypeLoc(templateSpecializationTypeLoc(
- hasAnyTemplateArgumentLoc(templateArgumentLoc())))))));
+ functionDecl(hasDescendant(varDecl(hasTypeLoc(elaboratedTypeLoc(
+ hasNamedTypeLoc(templateSpecializationTypeLoc(
+ hasAnyTemplateArgumentLoc(templateArgumentLoc())))))))));
}
TEST_P(ImportDecl, ImportUsingEnumDecl) {
"template<typename ...T> struct C : T... { using T::operator()...; };"
"C<A, B> declToImport;",
Lang_CXX20, "", Lang_CXX20, Verifier,
- varDecl(hasType(templateSpecializationType(hasDeclaration(
- classTemplateSpecializationDecl(hasDescendant(usingPackDecl())))))));
+ varDecl(hasType(elaboratedType(namesType(templateSpecializationType(
+ hasDeclaration(classTemplateSpecializationDecl(
+ hasDescendant(usingPackDecl())))))))));
}
/// \brief Matches shadow declarations introduced into a scope by a
ParmVarDecl *Param = Guide->getParamDecl(0);
// The type of the first param (which is a typedef) should match the typedef
// in the global scope.
- EXPECT_EQ(Param->getType()->castAs<TypedefType>()->getDecl(), Typedef);
+ EXPECT_EQ(Param->getType()->getAs<TypedefType>()->getDecl(), Typedef);
}
TEST_P(CTAD, DeductionGuideShouldReferToANonLocalTypedefInParamPtr) {
auto *Typedef = FirstDeclMatcher<TypedefNameDecl>().match(
TU, typedefNameDecl(hasName("U")));
ParmVarDecl *Param = Guide->getParamDecl(0);
- EXPECT_NE(Param->getType()->castAs<TypedefType>()->getDecl(), Typedef);
+ EXPECT_NE(Param->getType()->getAs<TypedefType>()->getDecl(), Typedef);
}
INSTANTIATE_TEST_SUITE_P(ParameterizedTests, CTAD,
CXXRecordDecl 'Record'
|-CXXRecordDecl 'Record'
|-CXXConstructorDecl 'Record'
-| |-CXXCtorInitializer 'struct Simple'
+| |-CXXCtorInitializer 'Simple'
| | `-CXXConstructExpr
-| |-CXXCtorInitializer 'struct Other'
+| |-CXXCtorInitializer 'Other'
| | `-CXXConstructExpr
| |-CXXCtorInitializer 'm_i'
| | `-IntegerLiteral
R"cpp(
CXXRecordDecl 'Record'
|-CXXConstructorDecl 'Record'
-| |-CXXCtorInitializer 'struct Simple'
+| |-CXXCtorInitializer 'Simple'
| | `-CXXConstructExpr
| |-CXXCtorInitializer 'm_i'
| | `-IntegerLiteral
[](PrintingPolicy &Policy) { Policy.FullyQualifiedName = false; }));
ASSERT_TRUE(PrintedTypeMatches(
- Code, {}, Matcher, "const N::Type<T> &",
+ Code, {}, Matcher, "const Type<T> &",
[](PrintingPolicy &Policy) { Policy.FullyQualifiedName = true; }));
}
EXPECT_TRUE(
matches("class Y { public: void x(); }; void z() {Y* y; y->x(); }",
- cxxMemberCallExpr(on(hasType(asString("class Y *"))))));
+ cxxMemberCallExpr(on(hasType(asString("Y *"))))));
EXPECT_TRUE(
matches("class X { void x(int x) {} };",
cxxMethodDecl(hasParameter(0, hasType(asString("int"))))));
EXPECT_TRUE(matches("namespace ns { struct A {}; } struct B { ns::A a; };",
fieldDecl(hasType(asString("ns::A")))));
- EXPECT_TRUE(
- matches("namespace { struct A {}; } struct B { A a; };",
- fieldDecl(hasType(asString("struct (anonymous namespace)::A")))));
+ EXPECT_TRUE(matches("namespace { struct A {}; } struct B { A a; };",
+ fieldDecl(hasType(asString("A")))));
}
TEST_P(ASTMatchersTest, HasOverloadedOperatorName) {
EXPECT_TRUE(matches(
Code,
cxxDependentScopeMemberExpr(
- hasObjectExpression(declRefExpr(hasType(templateSpecializationType(
- hasDeclaration(classTemplateDecl(has(cxxRecordDecl(
- has(cxxMethodDecl(hasName("mem")).bind("templMem")))))))))),
+ hasObjectExpression(declRefExpr(hasType(elaboratedType(namesType(
+ templateSpecializationType(hasDeclaration(classTemplateDecl(
+ has(cxxRecordDecl(has(cxxMethodDecl(hasName("mem"))
+ .bind("templMem")))))))))))),
memberHasSameNameAsBoundNode("templMem"))));
EXPECT_TRUE(
EXPECT_TRUE(matches(
Code,
cxxDependentScopeMemberExpr(
- hasObjectExpression(declRefExpr(hasType(templateSpecializationType(
- hasDeclaration(classTemplateDecl(has(cxxRecordDecl(
- has(fieldDecl(hasName("mem")).bind("templMem")))))))))),
+ hasObjectExpression(declRefExpr(
+ hasType(elaboratedType(namesType(templateSpecializationType(
+ hasDeclaration(classTemplateDecl(has(cxxRecordDecl(has(
+ fieldDecl(hasName("mem")).bind("templMem")))))))))))),
memberHasSameNameAsBoundNode("templMem"))));
}
EXPECT_TRUE(matches(
Code,
cxxDependentScopeMemberExpr(
- hasObjectExpression(declRefExpr(hasType(templateSpecializationType(
- hasDeclaration(classTemplateDecl(has(cxxRecordDecl(
- has(varDecl(hasName("mem")).bind("templMem")))))))))),
+ hasObjectExpression(declRefExpr(
+ hasType(elaboratedType(namesType(templateSpecializationType(
+ hasDeclaration(classTemplateDecl(has(cxxRecordDecl(
+ has(varDecl(hasName("mem")).bind("templMem")))))))))))),
memberHasSameNameAsBoundNode("templMem"))));
}
{
TEST_P(ASTMatchersTest, TypedefType) {
EXPECT_TRUE(matches("typedef int X; X a;",
- varDecl(hasName("a"), hasType(typedefType()))));
+ varDecl(hasName("a"), hasType(elaboratedType(
+ namesType(typedefType()))))));
}
TEST_P(ASTMatchersTest, TemplateSpecializationType) {
"N::M::D d;",
elaboratedType()));
EXPECT_TRUE(matches("class C {} c;", elaboratedType()));
- EXPECT_TRUE(notMatches("class C {}; C c;", elaboratedType()));
+ EXPECT_TRUE(matches("class C {}; C c;", elaboratedType()));
}
TEST_P(ASTMatchersTest, SubstTemplateTypeParmType) {
}
EXPECT_TRUE(matches(
"template <typename T> class C {}; C<char> var;",
- varDecl(hasName("var"), hasTypeLoc(templateSpecializationTypeLoc()))));
+ varDecl(hasName("var"), hasTypeLoc(elaboratedTypeLoc(hasNamedTypeLoc(
+ templateSpecializationTypeLoc()))))));
}
TEST_P(
}
TEST_P(ASTMatchersTest,
- ElaboratedTypeLocTest_DoesNotBindToNonElaboratedObjectDeclaration) {
+ ElaboratedTypeLocTest_BindsToBareElaboratedObjectDeclaration) {
if (!GetParam().isCXX()) {
return;
}
- EXPECT_TRUE(
- notMatches("class C {}; C c;",
- varDecl(hasName("c"), hasTypeLoc(elaboratedTypeLoc()))));
+ EXPECT_TRUE(matches("class C {}; C c;",
+ varDecl(hasName("c"), hasTypeLoc(elaboratedTypeLoc()))));
}
TEST_P(
if (!GetParam().isCXX()) {
return;
}
- EXPECT_TRUE(
- notMatches("namespace N { class D {}; } using N::D; D d;",
- varDecl(hasName("d"), hasTypeLoc(elaboratedTypeLoc()))));
+ EXPECT_TRUE(matches("namespace N { class D {}; } using N::D; D d;",
+ varDecl(hasName("d"), hasTypeLoc(elaboratedTypeLoc()))));
}
TEST_P(ASTMatchersTest,
- ElaboratedTypeLocTest_DoesNotBindToNonElaboratedStructDeclaration) {
+ ElaboratedTypeLocTest_BindsToBareElaboratedStructDeclaration) {
if (!GetParam().isCXX()) {
return;
}
- EXPECT_TRUE(
- notMatches("struct s {}; s ss;",
- varDecl(hasName("ss"), hasTypeLoc(elaboratedTypeLoc()))));
+ EXPECT_TRUE(matches("struct s {}; s ss;",
+ varDecl(hasName("ss"), hasTypeLoc(elaboratedTypeLoc()))));
}
TEST_P(ASTMatchersTest, LambdaCaptureTest) {
parmVarDecl(hasType(namedDecl(hasName("T"))))));
// InjectedClassNameType
EXPECT_TRUE(matches("template <typename T> struct S {"
- " void f(S s);"
- "};",
- parmVarDecl(hasType(injectedClassNameType()))));
+ " void f(S s);"
+ "};",
+ parmVarDecl(hasType(elaboratedType(
+ namesType(injectedClassNameType()))))));
EXPECT_TRUE(notMatches("template <typename T> struct S {"
- " void g(S<T> s);"
- "};",
- parmVarDecl(hasType(injectedClassNameType()))));
+ " void g(S<T> s);"
+ "};",
+ parmVarDecl(hasType(elaboratedType(
+ namesType(injectedClassNameType()))))));
// InjectedClassNameType -> CXXRecordDecl
EXPECT_TRUE(matches("template <typename T> struct S {"
" void f(S s);"
}
TEST(HasDeclaration, HasDeclarationOfTypeWithDecl) {
- EXPECT_TRUE(matches("typedef int X; X a;",
- varDecl(hasName("a"),
- hasType(typedefType(hasDeclaration(decl()))))));
+ EXPECT_TRUE(matches(
+ "typedef int X; X a;",
+ varDecl(hasName("a"), hasType(elaboratedType(namesType(
+ typedefType(hasDeclaration(decl()))))))));
// FIXME: Add tests for other types with getDecl() (e.g. RecordType)
}
TEST(HasDeclaration, HasDeclarationOfTemplateSpecializationType) {
- EXPECT_TRUE(matches("template <typename T> class A {}; A<int> a;",
- varDecl(hasType(templateSpecializationType(
- hasDeclaration(namedDecl(hasName("A"))))))));
- EXPECT_TRUE(matches("template <typename T> class A {};"
- "template <typename T> class B { A<T> a; };",
- fieldDecl(hasType(templateSpecializationType(
- hasDeclaration(namedDecl(hasName("A"))))))));
- EXPECT_TRUE(matches("template <typename T> class A {}; A<int> a;",
- varDecl(hasType(templateSpecializationType(
- hasDeclaration(cxxRecordDecl()))))));
+ EXPECT_TRUE(matches(
+ "template <typename T> class A {}; A<int> a;",
+ varDecl(hasType(elaboratedType(namesType(templateSpecializationType(
+ hasDeclaration(namedDecl(hasName("A"))))))))));
+ EXPECT_TRUE(matches(
+ "template <typename T> class A {};"
+ "template <typename T> class B { A<T> a; };",
+ fieldDecl(hasType(elaboratedType(namesType(templateSpecializationType(
+ hasDeclaration(namedDecl(hasName("A"))))))))));
+ EXPECT_TRUE(matches(
+ "template <typename T> class A {}; A<int> a;",
+ varDecl(hasType(elaboratedType(namesType(
+ templateSpecializationType(hasDeclaration(cxxRecordDecl()))))))));
}
TEST(HasDeclaration, HasDeclarationOfCXXNewExpr) {
}
TEST(HasDeclaration, HasDeclarationOfTypeAlias) {
- EXPECT_TRUE(matches("template <typename T> using C = T; C<int> c;",
- varDecl(hasType(templateSpecializationType(
- hasDeclaration(typeAliasTemplateDecl()))))));
+ EXPECT_TRUE(matches(
+ "template <typename T> using C = T; C<int> c;",
+ varDecl(hasType(elaboratedType(namesType(templateSpecializationType(
+ hasDeclaration(typeAliasTemplateDecl()))))))));
}
TEST(HasUnqualifiedDesugaredType, DesugarsUsing) {
)cpp";
EXPECT_TRUE(matches(
- code, cxxRecordDecl(hasAnyBase(hasTypeLoc(loc(asString("class Foo")))))));
- EXPECT_TRUE(matches(
- code, cxxCtorInitializer(hasTypeLoc(loc(asString("class Foo"))))));
+ code, cxxRecordDecl(hasAnyBase(hasTypeLoc(loc(asString("Foo")))))));
+ EXPECT_TRUE(
+ matches(code, cxxCtorInitializer(hasTypeLoc(loc(asString("Foo"))))));
}
TEST(HasTypeLoc, MatchesCXXFunctionalCastExpr) {
EXPECT_TRUE(matches("auto* x = new int(3);",
cxxNewExpr(hasTypeLoc(loc(asString("int"))))));
EXPECT_TRUE(matches("class Foo{}; auto* x = new Foo();",
- cxxNewExpr(hasTypeLoc(loc(asString("class Foo"))))));
+ cxxNewExpr(hasTypeLoc(loc(asString("Foo"))))));
}
TEST(HasTypeLoc, MatchesCXXTemporaryObjectExpr) {
EXPECT_TRUE(
matches("struct Foo { Foo(int, int); }; auto x = Foo(1, 2);",
- cxxTemporaryObjectExpr(hasTypeLoc(loc(asString("struct Foo"))))));
+ cxxTemporaryObjectExpr(hasTypeLoc(loc(asString("Foo"))))));
}
TEST(HasTypeLoc, MatchesCXXUnresolvedConstructExpr) {
varDecl(hasName("x"), hasTypeLoc(loc(asString("int"))))));
EXPECT_TRUE(matches("int x(3);",
varDecl(hasName("x"), hasTypeLoc(loc(asString("int"))))));
- EXPECT_TRUE(
- matches("struct Foo { Foo(int, int); }; Foo x(1, 2);",
- varDecl(hasName("x"), hasTypeLoc(loc(asString("struct Foo"))))));
+ EXPECT_TRUE(matches("struct Foo { Foo(int, int); }; Foo x(1, 2);",
+ varDecl(hasName("x"), hasTypeLoc(loc(asString("Foo"))))));
// Make sure we don't crash on implicit constructors.
EXPECT_TRUE(notMatches("class X {}; X x;",
}
TEST(HasAnyTemplateArgumentLoc, BindsToSpecializationWithIntArgument) {
- EXPECT_TRUE(
- matches("template<typename T> class A {}; A<int> a;",
- varDecl(hasName("a"), hasTypeLoc(templateSpecializationTypeLoc(
- hasAnyTemplateArgumentLoc(hasTypeLoc(
- loc(asString("int")))))))));
+ EXPECT_TRUE(matches(
+ "template<typename T> class A {}; A<int> a;",
+ varDecl(hasName("a"),
+ hasTypeLoc(elaboratedTypeLoc(hasNamedTypeLoc(
+ templateSpecializationTypeLoc(hasAnyTemplateArgumentLoc(
+ hasTypeLoc(loc(asString("int")))))))))));
}
TEST(HasAnyTemplateArgumentLoc, BindsToSpecializationWithDoubleArgument) {
- EXPECT_TRUE(
- matches("template<typename T> class A {}; A<double> a;",
- varDecl(hasName("a"), hasTypeLoc(templateSpecializationTypeLoc(
- hasAnyTemplateArgumentLoc(hasTypeLoc(
- loc(asString("double")))))))));
+ EXPECT_TRUE(matches(
+ "template<typename T> class A {}; A<double> a;",
+ varDecl(hasName("a"),
+ hasTypeLoc(elaboratedTypeLoc(hasNamedTypeLoc(
+ templateSpecializationTypeLoc(hasAnyTemplateArgumentLoc(
+ hasTypeLoc(loc(asString("double")))))))))));
}
TEST(HasAnyTemplateArgumentLoc, BindsToExplicitSpecializationWithIntArgument) {
}
TEST(HasTemplateArgumentLoc, BindsToSpecializationWithIntArgument) {
- EXPECT_TRUE(matches(
- "template<typename T> class A {}; A<int> a;",
- varDecl(hasName("a"),
- hasTypeLoc(templateSpecializationTypeLoc(hasTemplateArgumentLoc(
- 0, hasTypeLoc(loc(asString("int")))))))));
+ EXPECT_TRUE(
+ matches("template<typename T> class A {}; A<int> a;",
+ varDecl(hasName("a"),
+ hasTypeLoc(elaboratedTypeLoc(hasNamedTypeLoc(
+ templateSpecializationTypeLoc(hasTemplateArgumentLoc(
+ 0, hasTypeLoc(loc(asString("int")))))))))));
}
TEST(HasTemplateArgumentLoc, BindsToSpecializationWithDoubleArgument) {
- EXPECT_TRUE(matches(
- "template<typename T> class A {}; A<double> a;",
- varDecl(hasName("a"),
- hasTypeLoc(templateSpecializationTypeLoc(hasTemplateArgumentLoc(
- 0, hasTypeLoc(loc(asString("double")))))))));
+ EXPECT_TRUE(
+ matches("template<typename T> class A {}; A<double> a;",
+ varDecl(hasName("a"),
+ hasTypeLoc(elaboratedTypeLoc(hasNamedTypeLoc(
+ templateSpecializationTypeLoc(hasTemplateArgumentLoc(
+ 0, hasTypeLoc(loc(asString("double")))))))))));
}
TEST(HasTemplateArgumentLoc, BindsToExplicitSpecializationWithIntArgument) {
}
TEST(HasNamedTypeLoc, DoesNotBindToNonElaboratedObjectDeclaration) {
- EXPECT_TRUE(notMatches(
+ EXPECT_TRUE(matches(
R"(
template <typename T>
class C {};
EXPECT_THAT(
ExpectedLocations,
UnorderedElementsAre(
-STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc()),
STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getBeginLoc()),
STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getEndLoc()),
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getBeginLoc()),
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getEndLoc()),
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getNextTypeLoc().getBeginLoc()),
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getNextTypeLoc().getEndLoc()),
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc()),
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getNextTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc()),
STRING_LOCATION_PAIR(CtorInit, getLParenLoc()),
STRING_LOCATION_PAIR(CtorInit, getRParenLoc()),
STRING_LOCATION_PAIR(CtorInit, getSourceLocation()),
-STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getBeginLoc()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getEndLoc()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getBeginLoc()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getEndLoc()),
STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getBeginLoc()),
STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getEndLoc())
));
EXPECT_THAT(
ExpectedRanges,
UnorderedElementsAre(
- STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getLocalSourceRange()),
- STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getSourceRange()),
- STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getLocalSourceRange()),
- STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getSourceRange()),
- STRING_LOCATION_PAIR(CtorInit, getSourceRange())));
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getNextTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getNextTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getSourceRange())));
// clang-format on
}
STRING_LOCATION_PAIR(CtorInit, getLParenLoc()),
STRING_LOCATION_PAIR(CtorInit, getRParenLoc()),
STRING_LOCATION_PAIR(CtorInit, getSourceLocation()),
-STRING_LOCATION_PAIR(CtorInit,
- getTypeSourceInfo()->getTypeLoc().getBeginLoc()),
-STRING_LOCATION_PAIR(CtorInit,
- getTypeSourceInfo()->getTypeLoc().getEndLoc()),
-STRING_LOCATION_PAIR(CtorInit,
- getTypeSourceInfo()->getTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc())
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getBeginLoc()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getEndLoc()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getBeginLoc()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getEndLoc()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getBeginLoc()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getEndLoc()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc())
));
// clang-format on
auto ExpectedRanges = FormatExpected<SourceRange>(Result.RangeAccessors);
+ // clang-format off
EXPECT_THAT(
ExpectedRanges,
UnorderedElementsAre(
- STRING_LOCATION_PAIR(CtorInit, getSourceRange()),
- STRING_LOCATION_PAIR(
- CtorInit,
- getTypeSourceInfo()->getTypeLoc().getLocalSourceRange()),
- STRING_LOCATION_PAIR(
- CtorInit, getTypeSourceInfo()->getTypeLoc().getSourceRange())));
+STRING_LOCATION_PAIR(CtorInit, getSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getSourceRange())
+ ));
+ // clang-format on
}
TEST(Introspection, SourceLocations_CXXCtorInitializer_pack) {
EXPECT_EQ(
llvm::makeArrayRef(ExpectedLocations),
(ArrayRef<std::pair<std::string, SourceLocation>>{
-STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getAs<clang::TemplateSpecializationTypeLoc>().getLAngleLoc()),
-STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getAs<clang::TemplateSpecializationTypeLoc>().getRAngleLoc()),
-STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getAs<clang::TemplateSpecializationTypeLoc>().getTemplateNameLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getLAngleLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getRAngleLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getTemplateNameLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getBeginLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getEndLoc()),
STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getBeginLoc()),
STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getEndLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getNextTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getLAngleLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getNextTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getRAngleLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getNextTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getTemplateNameLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getNextTypeLoc().getBeginLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getBaseClassLoc().getNextTypeLoc().getEndLoc()),
STRING_LOCATION_STDPAIR(CtorInit, getEllipsisLoc()),
STRING_LOCATION_STDPAIR(CtorInit, getLParenLoc()),
STRING_LOCATION_STDPAIR(CtorInit, getMemberLocation()),
STRING_LOCATION_STDPAIR(CtorInit, getRParenLoc()),
STRING_LOCATION_STDPAIR(CtorInit, getSourceLocation()),
-STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getLAngleLoc()),
-STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getRAngleLoc()),
-STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getTemplateNameLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getLAngleLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getRAngleLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getTemplateNameLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getBeginLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getEndLoc()),
STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getBeginLoc()),
-STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getEndLoc())
+STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getEndLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getLAngleLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getRAngleLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getTemplateNameLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getBeginLoc()),
+STRING_LOCATION_STDPAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getEndLoc())
}));
// clang-format on
auto ExpectedRanges = FormatExpected<SourceRange>(Result.RangeAccessors);
+ // clang-format off
EXPECT_THAT(
ExpectedRanges,
UnorderedElementsAre(
- STRING_LOCATION_PAIR(CtorInit,
- getBaseClassLoc().getLocalSourceRange()),
- STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getSourceRange()),
- STRING_LOCATION_PAIR(CtorInit, getSourceRange()),
- STRING_LOCATION_PAIR(
- CtorInit,
- getTypeSourceInfo()->getTypeLoc().getLocalSourceRange()),
- STRING_LOCATION_PAIR(
- CtorInit, getTypeSourceInfo()->getTypeLoc().getSourceRange())));
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getNextTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getBaseClassLoc().getNextTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getTypeSourceInfo()->getTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(CtorInit, getSourceRange())
+ ));
+ // clang-format on
}
TEST(Introspection, SourceLocations_CXXBaseSpecifier_plain) {
auto BoundNodes = ast_matchers::match(
decl(hasDescendant(cxxRecordDecl(hasDirectBase(
- cxxBaseSpecifier(hasType(asString("class A"))).bind("base"))))),
+ cxxBaseSpecifier(hasType(asString("A"))).bind("base"))))),
TU, Ctx);
EXPECT_EQ(BoundNodes.size(), 1u);
EXPECT_THAT(ExpectedLocations,
UnorderedElementsAre(
STRING_LOCATION_PAIR(Base, getBaseTypeLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getBeginLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getBeginLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getBeginLoc()),
STRING_LOCATION_PAIR(Base, getBeginLoc()),
-STRING_LOCATION_PAIR(Base, getEndLoc()),
-STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getEndLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getEndLoc()),
STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getEndLoc()),
-STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getBeginLoc())
+STRING_LOCATION_PAIR(Base, getEndLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc())
));
// clang-format on
// clang-format off
EXPECT_THAT(ExpectedRanges, UnorderedElementsAre(
-STRING_LOCATION_PAIR(Base, getSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getSourceRange()),
STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getSourceRange()),
-STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getLocalSourceRange())
+STRING_LOCATION_PAIR(Base, getSourceRange())
));
// clang-format on
}
auto BoundNodes = ast_matchers::match(
decl(hasDescendant(cxxRecordDecl(hasDirectBase(
- cxxBaseSpecifier(hasType(asString("class A"))).bind("base"))))),
+ cxxBaseSpecifier(hasType(asString("A"))).bind("base"))))),
TU, Ctx);
EXPECT_EQ(BoundNodes.size(), 1u);
// clang-format off
EXPECT_THAT(ExpectedLocations,
UnorderedElementsAre(
-STRING_LOCATION_PAIR(Base, getBaseTypeLoc()),
STRING_LOCATION_PAIR(Base, getBeginLoc()),
-STRING_LOCATION_PAIR(Base, getEndLoc()),
-STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc()),
+STRING_LOCATION_PAIR(Base, getBaseTypeLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getBeginLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getBeginLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getBeginLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getEndLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getEndLoc()),
STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getEndLoc()),
-STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getBeginLoc())
+STRING_LOCATION_PAIR(Base, getEndLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc())
));
// clang-format on
// clang-format off
EXPECT_THAT(ExpectedRanges, UnorderedElementsAre(
STRING_LOCATION_PAIR(Base, getSourceRange()),
-STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getSourceRange()),
STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getSourceRange())
));
// clang-format on
auto BoundNodes = ast_matchers::match(
decl(hasDescendant(cxxRecordDecl(hasDirectBase(
- cxxBaseSpecifier(hasType(asString("class A"))).bind("base"))))),
+ cxxBaseSpecifier(hasType(asString("A"))).bind("base"))))),
TU, Ctx);
EXPECT_EQ(BoundNodes.size(), 1u);
EXPECT_THAT(ExpectedLocations,
UnorderedElementsAre(
STRING_LOCATION_PAIR(Base, getBaseTypeLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getBeginLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getBeginLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getBeginLoc()),
STRING_LOCATION_PAIR(Base, getBeginLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getEndLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getEndLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getEndLoc()),
STRING_LOCATION_PAIR(Base, getEndLoc()),
-STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getBeginLoc()),
-STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc()),
-STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getEndLoc())
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getAs<clang::TypeSpecTypeLoc>().getNameLoc())
));
// clang-format on
// clang-format off
EXPECT_THAT(ExpectedRanges, UnorderedElementsAre(
-STRING_LOCATION_PAIR(Base, getSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getSourceRange()),
STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getSourceRange()),
-STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getLocalSourceRange())
+STRING_LOCATION_PAIR(Base, getSourceRange())
));
// clang-format on
}
EXPECT_THAT(ExpectedLocations,
UnorderedElementsAre(
STRING_LOCATION_PAIR(Base, getBaseTypeLoc()),
-STRING_LOCATION_PAIR(Base, getBeginLoc()),
-STRING_LOCATION_PAIR(Base, getEndLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getBeginLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getBeginLoc()),
STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getBeginLoc()),
-STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getTemplateNameLoc()),
-STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getLAngleLoc()),
+STRING_LOCATION_PAIR(Base, getBeginLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getTemplateNameLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getTemplateNameLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getLAngleLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getLAngleLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getEndLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getEndLoc()),
STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getEndLoc()),
-STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getRAngleLoc())
+STRING_LOCATION_PAIR(Base, getEndLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getRAngleLoc()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getAs<clang::TemplateSpecializationTypeLoc>().getRAngleLoc())
));
// clang-format on
// clang-format off
EXPECT_THAT(ExpectedRanges, UnorderedElementsAre(
-STRING_LOCATION_PAIR(Base, getSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getLocalSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getAs<clang::ElaboratedTypeLoc>().getNamedTypeLoc().getSourceRange()),
+STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getNextTypeLoc().getSourceRange()),
STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getSourceRange()),
-STRING_LOCATION_PAIR(Base, getTypeSourceInfo()->getTypeLoc().getLocalSourceRange())
+STRING_LOCATION_PAIR(Base, getSourceRange())
));
// clang-format on
}
a | ^1; a & ^1;
}
)cpp";
- EXPECT_THAT(collectPreferredTypes(Code), Each("enum A"));
+ EXPECT_THAT(collectPreferredTypes(Code), Each("A"));
Code = R"cpp(
enum class A {};
a | ^a; a & ^a;
}
)cpp";
- EXPECT_THAT(collectPreferredTypes(Code), Each("enum A"));
+ EXPECT_THAT(collectPreferredTypes(Code), Each("A"));
// Binary shifts.
Code = R"cpp(
c = ^c; c += ^c; c -= ^c; c *= ^c; c /= ^c; c %= ^c;
}
)cpp";
- EXPECT_THAT(collectPreferredTypes(Code), Each("class Cls"));
+ EXPECT_THAT(collectPreferredTypes(Code), Each("Cls"));
Code = R"cpp(
class Cls {};
ASSERT_TRUE(LD.has_value());
auto LDT = LD->getType(Context);
ASSERT_FALSE(LDT.isNull());
- const auto *DRecordType = dyn_cast<RecordType>(LDT);
+ const auto *DElaboratedType = dyn_cast<ElaboratedType>(LDT);
+ ASSERT_NE(DElaboratedType, nullptr);
+ const auto *DRecordType =
+ dyn_cast<RecordType>(DElaboratedType->getNamedType());
ASSERT_NE(DRecordType, nullptr);
EXPECT_EQ("TestStruct", DRecordType->getDecl()->getName());
}
const auto *RetReg = cast<TypedValueRegion>(RetVal->getAsRegion());
const Expr *OrigExpr = Call.getOriginExpr();
- ASSERT_EQ(OrigExpr->getType(), RetReg->getValueType());
+ ASSERT_EQ(OrigExpr->getType()->getCanonicalTypeInternal(),
+ RetReg->getValueType()->getCanonicalTypeInternal());
}
};
ADD_FAILURE() << "Typename::getFullyQualifiedName failed for "
<< VD->getQualifiedNameAsString() << std::endl
<< " Actual: " << ActualName << std::endl
- << " Exepcted: " << ExpectedName;
+ << " Expected: " << ExpectedName;
}
}
return true;
// named namespaces inside anonymous namespaces
-TEST(QualTypeNameTest, getFullyQualifiedName) {
+TEST(QualTypeNameTest, Simple) {
TypeNameVisitor Visitor;
// Simple case to test the test framework itself.
Visitor.ExpectedQualTypeNames["CheckInt"] = "int";
"};\n"
"EnumScopeClass::AnEnum AnEnumVar;\n",
TypeNameVisitor::Lang_CXX11);
+}
+TEST(QualTypeNameTest, Complex) {
TypeNameVisitor Complex;
Complex.ExpectedQualTypeNames["CheckTX"] = "B::TX";
Complex.runOver(
" TX CheckTX;"
" struct A { typedef int X; };"
"}");
+}
+TEST(QualTypeNameTest, DoubleUsing) {
TypeNameVisitor DoubleUsing;
DoubleUsing.ExpectedQualTypeNames["direct"] = "a::A<0>";
DoubleUsing.ExpectedQualTypeNames["indirect"] = "b::B";
B double_indirect;
}
)cpp");
+}
+TEST(QualTypeNameTest, GlobalNsPrefix) {
TypeNameVisitor GlobalNsPrefix;
GlobalNsPrefix.WithGlobalNsPrefix = true;
GlobalNsPrefix.ExpectedQualTypeNames["IntVal"] = "int";
" }\n"
"}\n"
);
+}
+TEST(QualTypeNameTest, InlineNamespace) {
TypeNameVisitor InlineNamespace;
InlineNamespace.ExpectedQualTypeNames["c"] = "B::C";
InlineNamespace.runOver("inline namespace A {\n"
"using namespace A::B;\n"
"C c;\n",
TypeNameVisitor::Lang_CXX11);
+}
+TEST(QualTypeNameTest, AnonStrucs) {
TypeNameVisitor AnonStrucs;
AnonStrucs.ExpectedQualTypeNames["a"] = "short";
AnonStrucs.ExpectedQualTypeNames["un_in_st_1"] =
TEST(RecursiveASTVisitor, VisitsCXXBaseSpecifiersOfSelfReferentialType) {
TypeLocVisitor Visitor;
- Visitor.ExpectMatch("X<class Y>", 2, 18);
+ Visitor.ExpectMatch("X<Y>", 2, 18, 2);
EXPECT_TRUE(Visitor.runOver(
"template<typename T> class X {};\n"
"class Y : public X<Y> {};"));
T& operator*() const;
};
}
+ template<class T> T desugar() { return T(); };
)cc";
return (Preface + ExtraPreface + "auto stencil_test_snippet = []{" +
StatementCode + "};")
TEST_F(StencilTest, DescribeUnqualifiedType) {
std::string Snippet = "using N::C; C c; c;";
- std::string Expected = "N::C";
+ std::string Expected = "C";
auto StmtMatch =
matchStmt(Snippet, declRefExpr(hasType(qualType().bind("type"))));
ASSERT_TRUE(StmtMatch);
}
TEST_F(StencilTest, DescribeAnonNamespaceType) {
- std::string Snippet = "AnonC c; c;";
+ std::string Snippet = "auto c = desugar<AnonC>(); c;";
std::string Expected = "(anonymous namespace)::AnonC";
auto StmtMatch =
matchStmt(Snippet, declRefExpr(hasType(qualType().bind("type"))));
self.runCmd("settings set target.import-std-module true")
+ size_type = "size_type"
+ value_type = "value_type"
+ iterator = "iterator"
+ riterator = "reverse_iterator"
# Test inspecting an array of integers.
array_type = "std::array<int, 3>"
- size_type = "std::array::size_type"
- value_type = array_type + "::value_type"
-
- iterator = array_type + "::iterator"
- riterator = array_type + "::reverse_iterator"
-
self.expect_expr("a",
result_type=array_type,
result_children=[
# Same again with an array that has an element type from debug info.
array_type = "std::array<DbgInfo, 1>"
- size_type = "std::array::size_type"
- value_type = array_type + "::value_type"
- iterator = array_type + "::iterator"
- riterator = array_type + "::reverse_iterator"
dbg_info_elem_children = [ValueCheck(value="4")]
dbg_info_elem = [ValueCheck(children=dbg_info_elem_children)]
self.runCmd("settings set target.import-std-module true")
deque_type = "std::deque<int>"
- size_type = deque_type + "::size_type"
- value_type = "std::__deque_base<int, std::allocator<int> >::value_type"
- iterator = deque_type + "::iterator"
+ size_type = "size_type"
+ value_type = "value_type"
+ iterator = "iterator"
iterator_children = [
ValueCheck(name="__m_iter_"),
ValueCheck(name="__ptr_")
]
- riterator = deque_type + "::reverse_iterator"
+ riterator = "reverse_iterator"
riterator_children = [
ValueCheck(name="__t"),
ValueCheck(name="current")
self.runCmd("settings set target.import-std-module true")
deque_type = "std::deque<Foo>"
- size_type = deque_type + "::size_type"
- value_type = "std::__deque_base<Foo, std::allocator<Foo> >::value_type"
+ size_type = "size_type"
+ value_type = "value_type"
- iterator_type = deque_type + "::iterator"
+ iterator_type = "iterator"
iterator_children = [
ValueCheck(name="__m_iter_"),
ValueCheck(name="__ptr_")
]
- riterator_type = deque_type + "::reverse_iterator"
+ riterator_type = "reverse_iterator"
riterator_children = [
ValueCheck(name="__t"),
ValueCheck(name="current")
self.runCmd("settings set target.import-std-module true")
list_type = "std::forward_list<Foo>"
- value_type = list_type + "::value_type"
+ value_type = "value_type"
# FIXME: This has three elements in it but the formatter seems to
# calculate the wrong size and contents.
self.runCmd("settings set target.import-std-module true")
list_type = "std::forward_list<int>"
- value_type = list_type + "::value_type"
+ value_type = "value_type"
# FIXME: This has three elements in it but the formatter seems to
# calculate the wrong size and contents.
self.runCmd("settings set target.import-std-module true")
list_type = "std::list<Foo>"
- size_type = list_type + "::size_type"
- value_type = list_type + "::value_type"
+ size_type = "size_type"
+ value_type = "value_type"
self.expect_expr("a",
result_type=list_type,
self.runCmd("settings set target.import-std-module true")
list_type = "std::list<int>"
- size_type = list_type + "::size_type"
- value_type = list_type + "::value_type"
+ size_type = "size_type"
+ value_type = "value_type"
- iteratorvalue = "std::__list_iterator<int, void *>::value_type"
- riterator_value = "std::__list_iterator<int, void *>::value_type"
+ iteratorvalue = "value_type"
+ riterator_value = "value_type"
self.expect_expr("a",
result_type=list_type,
self.runCmd("settings set target.import-std-module true")
queue_type = "std::queue<C>"
- size_type = queue_type + "::size_type"
- value_type = "std::__deque_base<C, std::allocator<C> >::value_type"
+ size_type = "size_type"
+ value_type = "value_type"
# Test std::queue functionality with a std::deque.
self.expect_expr(
# Test std::queue functionality with a std::list.
queue_type = "std::queue<C, std::list<C> >"
- size_type = queue_type + "::size_type"
- value_type = "std::list<C>::value_type"
self.expect_expr(
"q_list",
result_type=queue_type,
lldb.SBFileSpec("main.cpp"))
vector_type = "std::vector<bool>"
- size_type = vector_type + "::size_type"
+ size_type = "size_type"
self.runCmd("settings set target.import-std-module true")
self.runCmd("settings set target.import-std-module true")
vector_type = "std::vector<Foo>"
- size_type = vector_type + "::size_type"
- value_type = vector_type + "::value_type"
- iterator = vector_type + "::iterator"
+ size_type = "size_type"
+ value_type = "value_type"
+ iterator = "iterator"
# LLDB's formatter provides us with a artificial 'item' member.
iterator_children = [ValueCheck(name="item")]
- riterator = vector_type + "::reverse_iterator"
+ riterator = "reverse_iterator"
riterator_children = [
ValueCheck(name="__t"),
ValueCheck(name="current")
vector_type = "std::vector<int>"
vector_of_vector_type = "std::vector<" + vector_type + " >"
- size_type = vector_of_vector_type + "::size_type"
+ size_type = "size_type"
+ value_type = "value_type"
self.runCmd("settings set target.import-std-module true")
]),
])
self.expect_expr("a.size()", result_type=size_type, result_value="2")
- front = self.expect_expr("a.front().front()", result_value="1")
- value_type = front.GetDisplayTypeName()
- self.assertIn(value_type, [
- "std::vector<int>::value_type", # Pre-D112976
- "std::__vector_base<int, std::allocator<int> >::value_type", # Post-D112976
- ])
+ front = self.expect_expr("a.front().front()", result_type=value_type,
+ result_value="1")
self.expect_expr("a[1][1]", result_type=value_type, result_value="2")
self.expect_expr("a.back().at(0)",
result_type=value_type,
self.runCmd("settings set target.import-std-module true")
vector_type = "std::vector<int>"
- size_type = vector_type + "::size_type"
- iterator = vector_type + "::iterator"
+ size_type = "size_type"
+ value_type = "value_type"
+ iterator = "iterator"
# LLDB's formatter provides us with a artificial 'item' member.
iterator_children = [ValueCheck(name="item")]
- riterator = vector_type + "::reverse_iterator"
+ riterator = "reverse_iterator"
riterator_children = [
ValueCheck(name="__t"),
ValueCheck(name="current")
ValueCheck(value="2")
])
self.expect_expr("a.size()", result_type=size_type, result_value="3")
- front = self.expect_expr("a.front()", result_value="3")
- value_type = front.GetDisplayTypeName()
- self.assertIn(value_type, [
- "std::vector<int>::value_type", # Pre-D112976
- "std::__vector_base<int, std::allocator<int> >::value_type", # Post-D112976
- ])
+ front = self.expect_expr("a.front()", result_type=value_type,
+ result_value="3")
self.expect_expr("a[1]", result_type=value_type, result_value="1")
self.expect_expr("a.back()", result_type=value_type, result_value="2")