
(This relands 59337263ab45d7657e and makes sure comma operator diagnostics are suppressed in a SFINAE context.) While at it, add the diagnosis message "left operand of comma operator has no effect" (used by GCC) for comma operator. This also makes Clang diagnose in the constant evaluation context which aligns with GCC/MSVC behavior. (https://godbolt.org/z/7zxb8Tx96) Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D103938
19 lines
510 B
C
19 lines
510 B
C
|
|
#define Outer(action) action
|
|
|
|
void completeParam(int param) {
|
|
;
|
|
Outer(__extension__({ _Pragma("clang diagnostic push") }));
|
|
param;
|
|
}
|
|
|
|
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:7:1 %s | FileCheck %s
|
|
// CHECK: param : [#int#]param
|
|
|
|
void completeParamPragmaError(int param) {
|
|
Outer(__extension__({ _Pragma(2) })); // expected-error {{_Pragma takes a parenthesized string literal}}
|
|
param;
|
|
}
|
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -code-completion-at=%s:16:1 %s | FileCheck %s
|