summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/constant-expression.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-01-15 03:51:30 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-01-15 03:51:30 +0000
commit2ec4061e39908f73bdb7d75da9f4374d001809eb (patch)
treef14622407fbcf50017bfb30bf1170bf2c7686645 /clang/test/SemaCXX/constant-expression.cpp
parentb19ac0d6ca6c49de2e45c3c987d0894af2f4c54e (diff)
downloadbcm5719-llvm-2ec4061e39908f73bdb7d75da9f4374d001809eb.tar.gz
bcm5719-llvm-2ec4061e39908f73bdb7d75da9f4374d001809eb.zip
Pedantic diagnostic correction: in C++, we have integral constant expressions,
not integer constant expressions. In passing, fix the 'folding is an extension' diagnostic to not claim we're accepting the code, since that's not true in -pedantic-errors mode, and add this diagnostic to -Wgnu. llvm-svn: 148209
Diffstat (limited to 'clang/test/SemaCXX/constant-expression.cpp')
-rw-r--r--clang/test/SemaCXX/constant-expression.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/test/SemaCXX/constant-expression.cpp b/clang/test/SemaCXX/constant-expression.cpp
index 061e77591b1..23a4dda7083 100644
--- a/clang/test/SemaCXX/constant-expression.cpp
+++ b/clang/test/SemaCXX/constant-expression.cpp
@@ -88,10 +88,10 @@ enum {
void diags(int n) {
switch (n) {
- case (1/0, 1): // expected-error {{not an integer constant expression}} expected-note {{division by zero}}
- case (int)(1/0, 2.0): // expected-error {{not an integer constant expression}} expected-note {{division by zero}}
- case __imag(1/0): // expected-error {{not an integer constant expression}} expected-note {{division by zero}}
- case (int)__imag((double)(1/0)): // expected-error {{not an integer constant expression}} expected-note {{division by zero}}
+ case (1/0, 1): // expected-error {{not an integral constant expression}} expected-note {{division by zero}}
+ case (int)(1/0, 2.0): // expected-error {{not an integral constant expression}} expected-note {{division by zero}}
+ case __imag(1/0): // expected-error {{not an integral constant expression}} expected-note {{division by zero}}
+ case (int)__imag((double)(1/0)): // expected-error {{not an integral constant expression}} expected-note {{division by zero}}
;
}
}
OpenPOWER on IntegriCloud