[LLVMbugs] [Bug 12713] New: Unbalanced decltype crashes the frontend

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 1 06:54:31 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=12713

             Bug #: 12713
           Summary: Unbalanced decltype crashes the frontend
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: llvm-bugs at quasiparticle.net
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


#include <type_traits>

template<class T>
void foo(typename std::conditional<false, decltype((1), int>::type)
{
}

int main()
{
    return foo<int>(0);
}

Note the missing second ) in the argument definition of foo. Compiling this
code results in an assert on my machine:

bar.cpp:6:6: error: expected '(' for function-style cast or type
      construction
                int>::type)
                ~~~^
clang: /srv/build/clang-svn/src/llvm/tools/clang/lib/Lex/PPCaching.cpp:101:
void clang::Preprocessor::AnnotatePreviousCachedTokens(const clang::Token &):
Assertion `CachedTokens[CachedLexPos-1].getLastLoc() ==
Tok.getAnnotationEndLoc() && "The annotation should be until the most recent
cached token"' failed.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list