xref: /minix3/external/bsd/llvm/dist/clang/test/CXX/drs/dr16xx.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
3*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
4*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++1z -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
5*0a6a1f1dSLionel Sambuc 
6*0a6a1f1dSLionel Sambuc #if __cplusplus < 201103L
7*0a6a1f1dSLionel Sambuc // expected-no-diagnostics
8*0a6a1f1dSLionel Sambuc #endif
9*0a6a1f1dSLionel Sambuc 
10*0a6a1f1dSLionel Sambuc namespace dr1684 { // dr1684: 3.6
11*0a6a1f1dSLionel Sambuc #if __cplusplus >= 201103L
12*0a6a1f1dSLionel Sambuc   struct NonLiteral { // expected-note {{because}}
13*0a6a1f1dSLionel Sambuc     NonLiteral();
fdr1684::NonLiteral14*0a6a1f1dSLionel Sambuc     constexpr int f() { return 0; } // expected-warning 0-1{{will not be implicitly 'const'}}
15*0a6a1f1dSLionel Sambuc   };
f(NonLiteral &)16*0a6a1f1dSLionel Sambuc   constexpr int f(NonLiteral &) { return 0; }
f(NonLiteral)17*0a6a1f1dSLionel Sambuc   constexpr int f(NonLiteral) { return 0; } // expected-error {{not a literal type}}
18*0a6a1f1dSLionel Sambuc #endif
19*0a6a1f1dSLionel Sambuc }
20