teak-llvm/clang/test/FixIt/no-fixit.cpp
Alex Lorenz 56fb6fef50 [Sema] Improve the error diagnostic for dot destructor calls on pointer objects
This commit improves the mismatched destructor type error by detecting when the
destructor call has used a '.' instead of a '->' on a pointer to the destructed
type. The diagnostic now suggests to use '->' instead of '.', and adds a fixit
where appropriate.

rdar://28766702

Differential Revision: https://reviews.llvm.org/D25817

llvm-svn: 292615
2017-01-20 15:38:58 +00:00

26 lines
407 B
C++

// RUN: not %clang_cc1 -fdiagnostics-parseable-fixits -x c++ -std=c++11 %s 2>&1 | FileCheck %s
// test that the diagnostics produced by this code do not include fixit hints
// CHECK-NOT: fix-it:
template<template<typename> +> void func();
struct {
void i() {
(void)&i;
}
} x;
namespace dotPointerDestructor {
struct Bar {
~Bar() = delete;
};
void bar(Bar *o) {
o.~Bar(); // no fixit
}
}