Add some missing ProhibitAttributes calls to some declaration-like #pragmas.
llvm-svn: 190806
This commit is contained in:
parent
fd68777c7b
commit
12a41bd3e0
|
@ -303,9 +303,11 @@ Retry:
|
|||
return StmtEmpty();
|
||||
|
||||
case tok::annot_pragma_captured:
|
||||
ProhibitAttributes(Attrs);
|
||||
return HandlePragmaCaptured();
|
||||
|
||||
case tok::annot_pragma_openmp:
|
||||
ProhibitAttributes(Attrs);
|
||||
return ParseOpenMPDeclarativeOrExecutableDirective();
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s
|
||||
|
||||
void foo() {
|
||||
}
|
||||
|
@ -44,6 +44,10 @@ int main(int argc, char **argv) {
|
|||
return 1; // expected-error {{cannot return from OpenMP region}}
|
||||
}
|
||||
|
||||
[[]] // expected-error {{an attribute list cannot appear here}}
|
||||
#pragma omp parallel
|
||||
for (int n = 0; n < 100; ++n) {}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -164,3 +164,10 @@ void test_capture_variadic() {
|
|||
(void)captured_sum(1, 2, 3); // OK
|
||||
(void)captured_sum(1, 2, 3, 4, 5); // OK
|
||||
}
|
||||
|
||||
void test_capture_with_attributes() {
|
||||
[[]] // expected-error {{an attribute list cannot appear here}}
|
||||
#pragma clang __debug captured
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue