
This removes the delayed typo correction functionality from Clang (regular typo correction still remains) due to fragility of the solution. An RFC was posted here: https://discourse.llvm.org/t/rfc-removing-support-for-delayed-typo-correction/86631 and while that RFC was asking for folks to consider stepping up to be maintainers, and we did have a few new contributors show some interest, experiments show that it's likely worth it to remove this functionality entirely and focus efforts on improving regular typo correction. This removal fixes ~20 open issues (quite possibly more), improves compile time performance by roughly .3-.4% (https://llvm-compile-time-tracker.com/?config=Overview&stat=instructions%3Au&remote=AaronBallman&sortBy=date), and does not appear to regress diagnostic behavior in a way we wouldn't find acceptable. Fixes #142457 Fixes #139913 Fixes #138850 Fixes #137867 Fixes #137860 Fixes #107840 Fixes #93308 Fixes #69470 Fixes #59391 Fixes #58172 Fixes #46215 Fixes #45915 Fixes #45891 Fixes #44490 Fixes #36703 Fixes #32903 Fixes #23312 Fixes #69874
158 lines
5.9 KiB
C++
158 lines
5.9 KiB
C++
// RUN: %clang_cc1 %s -fopenacc -verify
|
|
|
|
struct NotConvertible{} NC;
|
|
struct Incomplete *SomeIncomplete; // #INCOMPLETE
|
|
enum E{} SomeE;
|
|
enum class E2{} SomeE2;
|
|
|
|
struct CorrectConvert {
|
|
operator int();
|
|
} Convert;
|
|
|
|
struct ExplicitConvertOnly {
|
|
explicit operator int() const; // #EXPL_CONV
|
|
} Explicit;
|
|
|
|
struct AmbiguousConvert{
|
|
operator int(); // #AMBIG_INT
|
|
operator short(); // #AMBIG_SHORT
|
|
operator float();
|
|
} Ambiguous;
|
|
|
|
short some_short();
|
|
int some_int();
|
|
long some_long();
|
|
|
|
void Test() {
|
|
#pragma acc kernels num_gangs(1)
|
|
while(1);
|
|
|
|
// expected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'serial' directive}}
|
|
#pragma acc serial num_gangs(1)
|
|
while(1);
|
|
|
|
#pragma acc parallel num_gangs(1)
|
|
while(1);
|
|
|
|
// expected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'serial' directive}}
|
|
#pragma acc serial num_gangs(some_short(), some_int(), some_long())
|
|
while(1);
|
|
|
|
#pragma acc parallel num_gangs(some_short(), some_int(), some_long())
|
|
while(1);
|
|
|
|
// expected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'serial' directive}}
|
|
#pragma acc serial num_gangs(some_short(), some_int(), some_long(), SomeE)
|
|
while(1);
|
|
|
|
// expected-error@+1{{too many integer expression arguments provided to OpenACC 'num_gangs' clause: 'parallel' directive expects maximum of 3, 4 were provided}}
|
|
#pragma acc parallel num_gangs(some_short(), some_int(), some_long(), SomeE)
|
|
while(1);
|
|
|
|
// expected-error@+1{{too many integer expression arguments provided to OpenACC 'num_gangs' clause: 'kernels' directive expects maximum of 1, 2 were provided}}
|
|
#pragma acc kernels num_gangs(1, 2)
|
|
while(1);
|
|
|
|
// expected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'serial' directive}}
|
|
#pragma acc serial num_gangs(1, 2)
|
|
while(1);
|
|
|
|
#pragma acc parallel num_gangs(1, 2)
|
|
while(1);
|
|
|
|
// expected-error@+3{{multiple conversions from expression type 'struct AmbiguousConvert' to an integral type}}
|
|
// expected-note@#AMBIG_INT{{conversion to integral type 'int'}}
|
|
// expected-note@#AMBIG_SHORT{{conversion to integral type 'short'}}
|
|
#pragma acc parallel num_gangs(Ambiguous)
|
|
while(1);
|
|
|
|
// expected-error@+1{{OpenACC clause 'num_gangs' requires expression of integer type ('struct NotConvertible' invalid)}}
|
|
#pragma acc parallel num_gangs(NC, SomeE)
|
|
while(1);
|
|
|
|
// expected-error@+1{{OpenACC clause 'num_gangs' requires expression of integer type ('struct NotConvertible' invalid)}}
|
|
#pragma acc parallel num_gangs(SomeE, NC)
|
|
while(1);
|
|
|
|
// expected-error@+3{{OpenACC integer expression requires explicit conversion from 'struct ExplicitConvertOnly' to 'int'}}
|
|
// expected-note@#EXPL_CONV{{conversion to integral type 'int'}}
|
|
// expected-error@+1{{OpenACC clause 'num_gangs' requires expression of integer type ('struct NotConvertible' invalid)}}
|
|
#pragma acc parallel num_gangs(Explicit, NC)
|
|
while(1);
|
|
|
|
// expected-error@+4{{OpenACC integer expression requires explicit conversion from 'struct ExplicitConvertOnly' to 'int'}}
|
|
// expected-note@#EXPL_CONV{{conversion to integral type 'int'}}
|
|
// expected-error@+2{{OpenACC clause 'num_gangs' requires expression of integer type ('struct NotConvertible' invalid)}}
|
|
// expected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'serial' directive}}
|
|
#pragma acc serial num_gangs(Explicit, NC)
|
|
while(1);
|
|
|
|
// expected-error@+6{{OpenACC integer expression requires explicit conversion from 'struct ExplicitConvertOnly' to 'int'}}
|
|
// expected-note@#EXPL_CONV{{conversion to integral type 'int'}}
|
|
// expected-error@+4{{OpenACC clause 'num_gangs' requires expression of integer type ('struct NotConvertible' invalid)}}
|
|
// expected-error@+3{{multiple conversions from expression type 'struct AmbiguousConvert' to an integral type}}
|
|
// expected-note@#AMBIG_INT{{conversion to integral type 'int'}}
|
|
// expected-note@#AMBIG_SHORT{{conversion to integral type 'short'}}
|
|
#pragma acc parallel num_gangs(Explicit, NC, Ambiguous)
|
|
while(1);
|
|
|
|
// expected-error@+7{{OpenACC integer expression requires explicit conversion from 'struct ExplicitConvertOnly' to 'int'}}
|
|
// expected-note@#EXPL_CONV{{conversion to integral type 'int'}}
|
|
// expected-error@+5{{OpenACC clause 'num_gangs' requires expression of integer type ('struct NotConvertible' invalid)}}
|
|
// expected-error@+4{{multiple conversions from expression type 'struct AmbiguousConvert' to an integral type}}
|
|
// expected-note@#AMBIG_INT{{conversion to integral type 'int'}}
|
|
// expected-note@#AMBIG_SHORT{{conversion to integral type 'short'}}
|
|
// expected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'serial' directive}}
|
|
#pragma acc serial num_gangs(Explicit, NC, Ambiguous)
|
|
while(1);
|
|
}
|
|
|
|
struct HasInt {
|
|
using IntTy = int;
|
|
using ShortTy = short;
|
|
static constexpr int value = 1;
|
|
static constexpr AmbiguousConvert ACValue;
|
|
static constexpr ExplicitConvertOnly EXValue;
|
|
|
|
operator char();
|
|
};
|
|
|
|
template <typename T>
|
|
void TestInst() {
|
|
// expected-error@+1{{no member named 'Invalid' in 'HasInt'}}
|
|
#pragma acc serial num_gangs(HasInt::Invalid)
|
|
while(1);
|
|
|
|
// expected-error@+2{{no member named 'Invalid' in 'HasInt'}}
|
|
// expected-note@#INST{{in instantiation of function template specialization}}
|
|
#pragma acc parallel num_gangs(T::Invalid)
|
|
while(1);
|
|
|
|
// expected-error@+1{{no member named 'Invalid' in 'HasInt'}}
|
|
#pragma acc parallel num_gangs(1, HasInt::Invalid)
|
|
while(1);
|
|
|
|
// expected-error@+1{{no member named 'Invalid' in 'HasInt'}}
|
|
#pragma acc parallel num_gangs(T::Invalid, 1)
|
|
while(1);
|
|
|
|
// expected-error@+1{{no member named 'Invalid' in 'HasInt'}}
|
|
#pragma acc serial num_gangs(1, HasInt::Invalid)
|
|
while(1);
|
|
|
|
// expected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'serial' directive}}
|
|
#pragma acc serial num_gangs(T::Invalid, 1)
|
|
while(1);
|
|
|
|
#pragma acc parallel num_gangs(T::value, typename T::IntTy{})
|
|
while(1);
|
|
|
|
// expected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'serial' directive}}
|
|
#pragma acc serial num_gangs(T::value, typename T::IntTy{})
|
|
while(1);
|
|
}
|
|
|
|
void Inst() {
|
|
TestInst<HasInt>(); // #INST
|
|
}
|